목록다시볼문제 (129)
넘치게 채우기
https://leetcode.com/problems/palindrome-partitioning/description/leetcode - Palindrome Partitioning문제 유형 : 문자열 처리, 재귀, dfs, 백트래킹문제 난이도 : Medium 문제Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. 문자열 s가 주어진다.모든 (s를 쪼갠 조각들이 팰린드롬 문자열)인 집합들을 반환하시오. ex-> "aab"는 ["a", "a", "b"]로 나누면 모두 팰린드롬인 문자열들로 나눈 것입니다. 풀이재귀..
https://leetcode.com/problems/find-the-maximum-sum-of-node-values/description/leetcode - Find the Maximum Sum of Node Values문제 유형 : 수학, 비트마스킹, 트리문제 난이도 : Hard 문제There exists an undirected tree with n nodes numbered 0 to n - 1. You are given a 0-indexed 2D integer array edges of length n - 1, where edges[i] = [ui, vi] indicates that there is an edge between nodes ui and vi in the tree. You are al..
https://leetcode.com/problems/distribute-coins-in-binary-tree/description/leetcode - Distribute Coins in Binary Tree문제 유형 : 이진트리, dfs, 재귀, 부분합문제 난이도 : Medium 문제You are given the root of a binary tree with n nodes where each node in the tree has node.val coins. There are n coins in total throughout the whole tree.In one move, we may choose two adjacent nodes and move one coin from one node to an..
https://leetcode.com/problems/find-the-safest-path-in-a-grid/description/leetcode - Find the Safest Path in a Grid문제 유형 : bfs, 우선순위 큐, 다익스트라, 최단거리문제 난이도 : Medium 문제You are given a 0-indexed 2D matrix grid of size n x n, where (r, c) represents:A cell containing a thief if grid[r][c] = 1An empty cell if grid[r][c] = 0You are initially positioned at cell (0, 0). In one move, you can move to any ad..
https://leetcode.com/problems/minimum-cost-to-hire-k-workers/description/leetcode - Minimum Cost to Hire K Workers문제 유형 : 우선순위 큐, 정렬문제 난이도 : Hard 문제There are n workers. You are given two integer arrays quality and wage where quality[i] is the quality of the ith worker and wage[i] is the minimum wage expectation for the ith worker.We want to hire exactly k workers to form a paid group. To hire a ..
https://leetcode.com/problems/number-of-wonderful-substrings/description/leetcode - Number of Wonderful Substrings문제 유형 : 비트마스킹, 비트 조작문제 난이도 : Medium 문제A wonderful string is a string where at most one letter appears an odd number of times.For example, "ccjjc" and "abab" are wonderful, but "ab" is not.Given a string word that consists of the first ten lowercase English letters ('a' through 'j'),..
https://leetcode.com/problems/minimum-number-of-operations-to-make-array-xor-equal-to-k/description/leetcode - Minimum Number of Operations to Make Array XOR Equal to K문제 유형 : 비트마스킹, 비트 조작문제 난이도 : Medium 문제You are given a 0-indexed integer array nums and a positive integer k.You can apply the following operation on the array any number of times:Choose any element of the array and flip a bit in i..
https://leetcode.com/problems/sum-of-distances-in-tree/description/leetcode - Sum of Distances in Tree문제 유형 : dfs, 재귀, 트리, 다이나믹 프로그래밍문제 난이도 : Hard 문제There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.You are given the integer n and the array edges where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.Return an array ..
https://leetcode.com/problems/freedom-trail/description/leetcode - Freedom Trail문제 유형 : 재귀 / dfs / 다이나믹 프로그래밍문제 난이도 : Hard 문제In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring" and use the dial to spell a specific keyword to open the door.Given a string ring that represents the code engraved on the outer ring and another..
https://leetcode.com/problems/minimum-falling-path-sum-ii/description/Leetcode - Minimum Falling Path Sum II문제 유형 : 다이나믹 프로그래밍문제 난이도 : Hard 문제Given an n x n integer matrix grid, return the minimum sum of a falling path with non-zero shifts.A falling path with non-zero shifts is a choice of exactly one element from each row of grid such that no two elements chosen in adjacent rows are in the same..