분류 전체보기
-
[Leetcode] 40. Combination Sum II코딩테스트 2021. 5. 6. 08:14
문제) 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 combination. Note: The solution set must not contain duplicate combinations. Example 1: Input: candidates = [10,1,2,7,6,1,5], target = 8 Output: [ [1,1,6], [1,2,5], [1,7]..
-
[Leetcode] 39. Combination Sum코딩테스트 2021. 5. 6. 00:42
문제) Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order. The same number may be chosen from candidates an unlimited number of times. Two combinations are unique if the frequency of at least one of the chosen numbers is different. It i..
-
[Leetcode] 75. Sort Colors코딩테스트 2021. 5. 3. 22:35
문제) Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue. We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively. Example 1: Input: nums = [2,0,2,1,1,0] Output: [0,0,1,1,2,2] Example 2: Input: nums = [2,0,1] Output: [0,1,2] Exampl..
-
[Leetcode] 57. Insert Interval코딩테스트 2021. 5. 2. 20:58
문제) Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted according to their start times. Example 1: Input: intervals = [[1,3],[6,9]], newInterval = [2,5] Output: [[1,5],[6,9]] Example 2: Input: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8] Output: [[1,2],[3,10],[12,16..
-
[leetcode] 147. Insertion Sort List코딩테스트 2021. 4. 29. 22:43
문제) Given the head of a singly linked list, sort the list using insertion sort, and return the sorted list's head. The steps of the insertion sort algorithm: Insertion sort iterates, consuming one input element each repetition and growing a sorted output list. At each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list and inser..
-
[Leetcode] 56. Merge Intervals코딩테스트 2021. 4. 27. 01:03
문제) Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. Example 1: Input: intervals = [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6]. Example 2: Input: intervals = [[..
-
[번역] Kubernetes의 resource memory limit 이해하기SW개발/Kubernetes 2021. 4. 26. 20:47
참고) 글을 좀 더 쉽게 이해하게 하기 위해 의역이 된 내용이 많습니다. 그리고 불필요해 보이는 내용은 빠져있고, 요약된 내용이 많으니 참고해주세요. 내가 쿠버네티스를 사용할 때, 테스트 단계에서 일어나지 않았던 이슈를 만나게 되었다. 그것은 바로 노드에 pod를 운영할만한 충분한 cpu나 memory가 없으면 pod가 pending 상태로 남아있게된다는 것이다. 노드에 cpu나 ram을 추가할 수 없을때, 어떻게 이 문제를 해결해야할까? 가장 단순한 답변은 노드를 하나 추가하는 것이다. 하지만 이것은 쿠버네티스의 가장 강력한 장점 중 하나인 "compute resource를 효율적으로 이용하는 것"을 잘 활용하지 못하는 것이다. 진짜 문제는 노드가 제공할 수 있는 resource가 너무 작은게 아니라 ..
-
[Leetcode] 395. Longest Substring with At Least K Repeating Characters코딩테스트 2021. 4. 25. 18:44
문제) Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than or equal to k. Example 1: Input: s = "aaabb", k = 3 Output: 3 Explanation: The longest substring is "aaa", as 'a' is repeated 3 times. Example 2: Input: s = "ababbc", k = 2 Output: 5 Explanation: The longest substring is "ababb", as 'a..