목록다시볼문제 (33)
넘치게 채우기
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bhCZEO/btsHIeBDf1U/7z60gCqEISQSZDQu15aby0/img.png)
https://leetcode.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/description/leetcode - Count Triplets That Can Form Two Arrays of Equal XOR문제 유형 : 부분합, 비트마스킹문제 난이도 : Medium 문제Given an array of integers arr.We want to select three indices i, j and k where (0 Let's define a and b as follows:a = arr[i] ^ arr[i + 1] ^ ... ^ arr[j - 1]b = arr[j] ^ arr[j + 1] ^ ... ^ arr[k]Note that..
https://leetcode.com/problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one/description/leetcode - Number of Steps to Reduce a Number in Binary Representation to One문제 유형 : 비트마스킹, 그리디문제 난이도 : Medium 문제Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules:If the current number is even, you have to d..
https://leetcode.com/problems/word-break-ii/description/leetcode - Word Break II문제 유형 : 문자열 처리, 다이나믹 프로그래밍문제 난이도 : Hard 문제Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences in any order.Note that the same word in the dictionary may be reused multiple times in the segmentatio..
https://leetcode.com/problems/maximum-score-words-formed-by-letters/description/leetcode - Maximum Score Words Formed by Letters문제 유형 : 재귀, 백트래킹, dfs, 문자열 처리문제 난이도 : Hard 문제Given a list of words, list of single letters (might be repeating) and score of every character.Return the maximum score of any valid set of words formed by using the given letters (words[i] cannot be used two or more times)..
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"]로 나누면 모두 팰린드롬인 문자열들로 나눈 것입니다. 풀이재귀..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/vNUVx/btsHu4eCScT/Sv6XwUDRYTgTcYThf9ttYK/img.png)
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'),..