목록다시볼문제 (33)
넘치게 채우기
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/H8kRv/btsG13nu5rV/Ma2FuclIJR5g9GGTkWEIC0/img.png)
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..
https://leetcode.com/problems/longest-ideal-subsequence/description/Leetcode - Longest Ideal Subsequence문제 유형 : 다이나믹 프로그래밍, 문자열처리문제 난이도 : Medium 문제You are given a string s consisting of lowercase letters and an integer k. We call a string t ideal if the following conditions are satisfied:t is a subsequence of the string s.The absolute difference in the alphabet order of every two adjacent letter..
https://leetcode.com/problems/minimum-height-trees/description/ Leetcode - Minimum Height Trees 문제 유형 : bfs / 위상 정렬 문제 난이도 : Medium 문제 A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles is a tree. Given a tree of n nodes labelled from 0 to n - 1, and an array of n - 1 edges where edges[i] = [ai, bi]..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/DLgl2/btsGBRuuDau/3VGkIZVHkY6vPASkSbr0z0/img.png)
https://leetcode.com/problems/maximal-rectangle/description/ Leetcode - Maximal Rectangle 문제 유형 : 히스토그램, 스택, 다이나믹 프로그래밍 문제 난이도 : Hard 문제 Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. rows x cols크기의 이진 행렬이 주어진다. 1로만 이루어진 가장 큰 직사각형을 찾아서 그 크기를 반환하시오. 풀이 풀이 1: 다이나믹 프로그래밍(동적계획법) 처음에는 각 자리별로 1로 이어진 왼쪽 끝과 위쪽 끝을 구한 뒤, 크기를 일..
https://leetcode.com/problems/remove-k-digits/description/ Leetcode - Remove K Digits 문제 유형 : 스택 문제 난이도 : Medium 문제 Given string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removing k digits from num. 양의정수를 표현하는 문자열 num이 주어집니다. num에서 k개의 정수를 제거한 가장 작은 수를 구하시오. 풀이 스택을 이용하여 풀 수 있다. 수를 하나씩 스택에 담는다. 만약에 이번에 넣을 수보다 큰 수들이 있다면, 그 수들은 기존 스택에서..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bVhmFd/btsGdSuDBab/6jZwn2HRRzNaFcwKOqucr0/img.png)
https://leetcode.com/problems/count-subarrays-with-fixed-bounds/description/ LeetCode - Count Subarrays With Fixed Bounds 문제 유형 : 슬라이딩 윈도우 문제 난이도 : Hard 문제 You are given an integer array nums and two integers minK and maxK. A fixed-bound subarray of nums is a subarray that satisfies the following conditions: The minimum value in the subarray is equal to minK. The maximum value in the subarray is..
https://leetcode.com/problems/subarrays-with-k-different-integers/ Leetcode - Subarrays with K Different Integers 문제 유형 : 슬라이딩 윈도우 / 해시 문제 난이도 : Hard 문제 Given an integer array nums and an integer k, return the number of good subarrays of nums. A good array is an array where the number of different integers in that array is exactly k. For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3..