목록2024/08 (32)
넘치게 채우기
https://leetcode.com/problems/combination-sum-ii/description/?envType=daily-question&envId=2024-08-13leetcode - Combination Sum II문제 유형 : 백트래킹, dfs, 재귀문제 난이도 : Medium 문제Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target.Each number in candidates may only be used once in the combin..
https://leetcode.com/problems/minimum-number-of-days-to-disconnect-island/description/leetcode - Minimum Number of Days to Disconnect Island문제 유형 : bfs / dfs, 그리디문제 난이도 : Hard 문제You are given an m x n binary grid grid where 1 represents land and 0 represents water. An island is a maximal 4-directionally (horizontal or vertical) connected group of 1's.The grid is said to be connected if we have e..
https://leetcode.com/problems/kth-largest-element-in-a-stream/description/?envType=daily-question&envId=2024-08-12leetcode = Kth Largest Element in a Stream문제 유형 : 우선순위 큐문제 난이도 : Easy 문제Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element.Implement KthLargest class:KthLargest(int k, int[] nums) Initi..
https://leetcode.com/problems/magic-squares-in-grid/description/?envType=daily-question&envId=2024-08-09leetcode - Magic Squares In Grid문제 유형 : 행렬문제 난이도 : Medium 문제A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum.Given a row x col grid of integers, how many 3 x 3 contiguous magic square subgrids are..
https://leetcode.com/problems/spiral-matrix-iii/submissions/1348374879/leetcode - Spiral Matrix III문제 유형 : 행렬, 구현문제 난이도 : Medium 문제You start at the cell (rStart, cStart) of an rows x cols grid facing east. The northwest corner is at the first row and column in the grid, and the southeast corner is at the last row and column.You will walk in a clockwise spiral shape to visit every position in thi..
https://leetcode.com/problems/integer-to-english-words/description/?envType=daily-question&envId=2024-08-07leetcode - Integer to English Words문제 유형 : 문자열 처리문제 난이도 : Hard 문제Convert a non-negative integer num to its English words representation.음수가 아닌 정수 num을 영어 단어 표현으로 변환하여라. 풀이num의 각 자릿수들을 저장하기 위해, 10짜리 크기의 배열을 만들어서 저장한다.일의자릿수부터 잘라 넣어서, 역순으로 저장시켰다.예제를 보다보면, 규칙을 알 수 있다.바로, 세 자리 씩 끊어서 변환되어서 적절한 접미..
https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-ii/?envType=daily-question&envId=2024-08-06leetcode - Minimum Number of Pushes to Type Word II문제 유형 : 문자열 처리문제 난이도 : Medium 문제You are given a string word containing lowercase English letters.Telephone keypads have keys mapped with distinct collections of lowercase English letters, which can be used to form words by pushing them...
https://leetcode.com/problems/kth-distinct-string-in-an-array/description/?envType=daily-question&envId=2024-08-05leetcode - Kth Distinct String in an Array문제 유형 : 해시, 문자열처리문제 난이도 : Easy 문제A distinct string is a string that is present only once in an array.Given an array of strings arr, and an integer k, return the kth distinct string present in arr. If there are fewer than k distinct strings, r..
https://leetcode.com/problems/range-sum-of-sorted-subarray-sums/description/?envType=daily-question&envId=2024-08-04leetcode - Range Sum of Sorted Subarray Sums문제 유형 : 정렬, 부분합문제 난이도 : Medium 문제You are given the array nums consisting of n positive integers. You computed the sum of all non-empty continuous subarrays from the array and then sorted them in non-decreasing order, creating a new array ..
https://leetcode.com/problems/make-two-arrays-equal-by-reversing-subarrays/description/?envType=daily-question&envId=2024-08-03leetcode - Make Two Arrays Equal by Reversing Subarrays문제 유형 : 정렬문제 난이도 : Easy 문제You are given two integer arrays of equal length target and arr. In one step, you can select any non-empty subarray of arr and reverse it. You are allowed to make any number of steps.Return ..