Category: Ideas
-
Reverse Linked List II
Problem https://leetcode.com/problems/reverse-linked-list-ii/description/ Solution Pseudo Code – Reversing a linked list
-
Implement Trie (Prefix Tree)
Problem https://leetcode.com/explore/learn/card/trie/147/basic-operations/1047/ Solution
-
Count Number of Nice Subarrays
Problem https://leetcode.com/problems/count-number-of-nice-subarrays/description/ Solution
-
Counting the number of subarrays
문제들 중, 특정 조건을 부합하는 subarray의 갯수를 구하는 문제 유형이 있다. 예를 들어, subarray 의 합이 k 가 되는 subarray 의 갯수를 구하라는 문제가 있다면, 이는 prefixSum + hashmap 을 통해 풀 수 있다! Problem https://leetcode.com/problems/subarray-sum-equals-k/description/ Solution Reference
-
Sliding Window
Pseudo Code – Moving two pointers dynamically Pseudo Code – Moving two pointers dynamically (Detailed Version) Pseudo Code – Fixed window size Reference
-
다이나믹 프로그래밍(Dynamic Programming)
** 다이나믹 프로그래밍이라는 이름은 실제 풀이 방법과는 무관하다! 정의 Memoization Time Complexity 풀이 방법 구현 방법 #1 – Top-Down 구현 방법 #2 – Bottom-Up Reference
-
비트 마스크 (Bitmask)
0,1 을 기반으로 비트 연산을 통해 접근하면 메모리 및 시간 복잡도에서 유리할 수 있다. 예시 현재 집합이 {1,3,4,5,9}이라고 할 때, 이 집합을 S라고 하자. S 집합의 수를 집합에 있는 수는 1, 없는 수는 0으로 나타내면, 1000111010 으로 나타낼 수 있다. 즉, 1번째 수는 있으므로 1, 2번째 수는 없으므로 0, 3번째…
