Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
704 | Binary Search | right-open, right-close | Easy | Arrays | |
27 | Remove Element | Brute Force, Two Pointer) | Easy | Arrays | Two pointer and brute force |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
977 | Squares of a Sorted Array | Python | Easy | Two pointer | Opposite Directions |
209 | Minimum Size Subarray Sum | Python | Medium | Sliding window | |
59 | Spiral Matrix II | Python | Medium | Simulation& Arrays | Use four directions instead of multiple for loops |
23 | Merge k Sorted Lists | Python | Hard | Linked List & min-heap | Need review heap |
88 | Merge Sorted Array | Python | Easy | Two Pointer | Need review |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
203 | Remove Linked List Elements | Python | Easy | Linked List | Review the properties of Linked List, implement iteration |
707 | Design Linked List | Python | Medium | Linked List | Great example for learning about the inner workings of Linked List |
206 | Reverse Linked List | Python | Easy | Linked List | review reversing a linked list |
Question# | Title | Solution | Difficulty | Topics | Complexity | Nodes |
---|---|---|---|---|---|---|
24 | Swap nodes in pairs | Stack - Python, Recursion - Python | Medium | Linked List | Stack: T:O(n),S:O(1) Recursion: T:O(n),S:O(n) | |
19 | Remove Nth Node From End of List | Two Pointer - Python | Medium | Linked List, Two Pointer | Two Pointer: T:O(n), S:O(1) | |
160 | Intersection of Two Linked Lists | Two Pointer - Python, Hashtable - Python | Easy | Linked List, Two Pointer, Hash Table | Two Pointer: T: O(n) S:O(1), Hashtable: T:O(n), S: O(n) | |
142 | Linked List Cycle II | HashTable - Python, Two Pointer - Python | Medium | Linked List, Hash Table, Two Pointer | Hash Table: T: O(n), S: O(n), Two Pointer: T:O(n),S:O(1) |
Question# | Title | Solution | Difficulty | Topics | Complexity | Nodes |
---|---|---|---|---|---|---|
242 | Valid Anagram | Counter-Space Save, Counter-easy coding | Easy | Hash Table, String | Space Save: T:O(n),S:O(1), Easy Coding: T:O(n),S:O(n) | |
349 | Intersection of Two Array | Set- Hash Table, dictionary-Hash Table | Easy | Hash Table, Array | set: T:O(n+m), S:(n+m), dictionary: T:O(n+m), S: O(n) | |
202 | Happy Number | Set - Hash Table, Two Pointer | Easy | Hash Table, Two Pointer | Set: T: O(d) where d is the numberof digits in n, S:O(k) where k is the number of unique digits in set(), Two Pointer: S: O(logn) where n is the size of the input value, T: O(1) | |
1 | Two Sum | Dictionary | Easy | Hash Table, Array | Hash Table: T: O(n), S: O(n) | |
34 | Find First and Last Position of Element in Sorted Array | bisect - Binary Search, regular - Binary Search | Medium | Hash Table, Array | bisect: T: O(logn), S: O(1), Regular binary Search: O(n) where n is the number of elements in the array, S: O(1) |
Question# | Title | Solution | Difficulty | Topics | Complexity | Nodes |
---|---|---|---|---|---|---|
454 | 4Sum II | 1. Concise Counter, 2. Dictionary, 3. Regular Counter | Medium | Hash Table, Array | Concise Counter: T:O(n^2),S:O(n^2) | |
383 | Ransom Note | 1. Concise Counter, 2. for + count, 3. count + all, 4. Dictionary, 5. Counter + sum | Easy | Hash Table, String, Counting | Counter: T/S: O(r + m) where r is the length of ransomNote and m is the leght of magazine | |
15 | 3Sum | 1. Two Pointer | Medium | Array, Two Pointers, Sorting | T: O(n^2), S: O(n^2) | |
18 | 4Sum | 1. Two Pointer | Medium | Hash Table, Array, Sorting | T: O(n^3), S: O(m) where m is the number of unique quadruplets that sums up to the target |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
344 | Reverse String | Python | Easy | String, Two Pointers | |
541 | Reverse StringII | Python | Easy | Two Pointer, String | |
54 | Kama-Replace numbers | Python | Easy | String | |
151 | Reverse Words in a String | Python | Medium | String, Two Pointer | |
55 | Kama-Right Rotate a String | Python | Easy | String |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
28 | Find the Index of the First Occurrence in a String | Python | Easy | String, Two Pointers | review kmp at 1/4/2024 |
459 | Repeated Substring Pattern | Python | Easy | Two Pointer, String | has reviewed kmp at 1/4/2024 |
268 | Smallest Missing Integer | Python | Easy | Array, Hash Table | set(), in-place Hashing |
Day 10 - Stack and Queue Part 1
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
232 | Implement Queue using Stacks | Python | Easy | Stack, Queue | |
225 | Implement Stack using Queues | Python | Easy | Stack, Queue |
Day 11 - Stack and Queue Part 2
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
20 | Valid Parentheses | Python | Easy | Stack, Dictionary | |
1047 | Remove All Adjacent Duplicates In String | Python | Easy | Stack, Dictionary | |
150 | Valid Parentheses | Python | Medium | Stack, Dictionary |
Day 13 - Stack and Queue Part 3
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
239 | Sliding Window Maximu | Python | Hard | Monotonic Queue, Heap, Priority Queue | |
347 | Top K Frequent Elements | Python | Medium | Min Heap, Priority Queue, Hash Table | |
692 | Top K Frequent Words | Python | Medium | Min Heap, Hash Table, Sorting | Need Review again |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
144 | Binary Tree Preorder Traversal | Python | Easy | Binary Tree | |
145 | Binary Tree Postorder Traversal | Python | Easy | Binary Tree | |
94 | Binary Tree Inorder Traversal | Python | Easy | Binary Tree |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
102 | Binary Tree Level Order Traversal | Python | Medium | Binary Tree | |
107 | Binary Tree Level Order Traversal II | Python | Medium | Binary Tree | |
199 | Binary Tree Right Side View | Python | Medium | Binary Tree | |
637 | Average of Levels in Binary Tree | Python | Easy | Binary Tree | |
429 | N-ary Tree Level Order Traversal | Python | Medium | N-ary Tree | |
515 | Find Largest Value in Each Tree Row | Python | Medium | Binary Tree | |
116 | Populating Next Right Pointers in Each Node | Python | Medium | Binary Tree | |
117 | Populating Next Right Pointers in Each Node II | Python | Medium | Binary Tree | |
104 | Maximum Depth of Binary Tree | Python | Easy | Binary Tree | |
111 | Minimum Depth of Binary Tree | Python | Easy | Binary Tree | |
226 | Invert Binary Tree | Python | Easy | Binary Tree | |
101 | Symmetric Tree | Python | Easy | Binary Tree |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
104 | Maximum Depth of Binary Tree | Python | Easy | Binary Tree | |
111 | Minimum Depth of Binary Tree | Python | Easy | Binary Tree | |
222 | Count Complete Tree Nodes | Python | Easy | Binary Tree |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
110 | Balanced Binary Tree | Python | Easy | Binary Tree | |
257 | Binary Tree Paths | Python | Easy | Binary Tree | |
404 | Sum of Left Leaves | Python | Easy | Binary Tree |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
513 | Find Bottom Left Tree Value | Python | Medium | Binary Tree | |
112 | Path Sum | Python | Easy | Binary Tree | |
106 | Construct Binary Tree from Inorder and Postorder Traversal | Python | Medium | Binary Tree |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
654 | Maximum Binary Tree | Python | Medium | Binary Tree | |
617 | Merge Two Binary Trees | Python | Easy | Binary Tree | |
700 | Search in a Binary Search Tree | Python | Easy | Binary Search Tree | |
98 | Validate Binary Search Tree | Python | Medium | Binary Search Tree |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
530 | Minimum Absolute Difference in BST | Python | Easy | Binary Search Tree | |
501 | Find Mode in Binary Search Tree | Python | Easy | Binary Search Tree | |
236 | Lowest Common Ancestor of a Binary Tree | Python | Medium | Binary Tree |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
235 | Lowest Common Ancestor of a Binary Search Tree | Python | Medium | Binary Search Tree | |
701 | Insert into a Binary Search Tree | Python | Medium | Binary Search Tree | |
450 | Delete Node in a BST | Python | Medium | Binary Search Tree |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
669 | Trim a Binary Search Tree | Python | Medium | Binary Search Tree | |
108 | Convert Sorted Array to Binary Search Tree | Python | Easy | Binary Search Tree | |
538 | Convert BST to Greater Tree | Python | Medium | Binary Search Tree |
Question# | Title | Solution | Difficulty | Topics | Nodes |
---|---|---|---|---|---|
77 | Combinations | Python | Medium | Backtracking |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
216 | Combination Sum III | Python | Medium | Backtracking | |
17 | Letter Combinations of a Phone Number | Python | Medium | Backtracking |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
39 | Combination Sum | Python | Medium | Backtracking | |
40 | Combination Sum II | Python | Medium | Backtracking | |
131 | Palindrome Partitioning | Python | Medium | Backtracking |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
93 | Restore IP Addresses | Python | Medium | Backtracking | |
78 | Subsets | Python | Medium | Backtracking | |
90 | Subsets II | Python | Medium | Backtracking |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
491 | Non-decreasing Subsequences | Python | Medium | Backtracking | |
46 | Permutations | Python | Medium | Backtracking | |
47 | Permutations II | Python | Medium | Backtracking |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
455 | Assign Cookies | Python | Easy | Greedy | |
376 | Wiggle Subsequence | Python | Medium | Greedy | |
53 | Maximum Subarray | Python | Medium | Greedy |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
122 | Best Time to Buy and Sell Stock II | Python | Medium | Greedy | |
55 | Jump Game | Python | Medium | Greedy | |
45 | Jump Game II | Python | Medium | Greedy | |
MS | Jump Game - MicroSoft | Python | – | Greedy |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
1005 | Maximize Sum Of Array After K Negations | Python | Easy | Greedy | |
134 | Gas Station | Python | Medium | Greedy | |
135 | Candy | Python | Hard | Greedy |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
860 | Lemonade Change | Python | Easy | Greedy | |
406 | Queue Reconstruction by Height | Python | Medium | Greedy | |
452 | Minimum Number of Arrows to Burst Balloons | Python | Medium | Greedy | |
9 | Palindrome Number | Python | Easy | Greedy |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
435 | Non-overlapping Intervals | Python | Medium | Greedy | 2/3 review |
763 | Partition Labels | Python | Medium | Greedy | 2/3 review |
56 | Merge Intervals | Python | Medium | Greedy | 2/3 review |
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
738 | Monotone Increasing Digits | Python | Medium | Greedy | |
968 | Binary Tree Cameras | Python | Hard | Greedy |
Day 38 - Dynamic Programming Part 1
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
509 | Fibonacci Number | Python | Easy | Dynamic Programming | be cautious for (n+1) |
70 | Climbing Stairs | Python | Easy | Dynamic Programming | |
746 | Min Cost Climbing Stairs | Python | Easy | Dynamic Programming | be caustious for (len(cost)) + 1 |
Day 39 - Dynamic Programming Part 2
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
62 | Unique Paths | Python | Medium | Dynamic Programming | review and consider space save |
63 | Unique Paths II | Python | Medium | Dynamic Programming |
Day 40 - Dynamic Programming Part 3
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
343 | Integer Break | Python | Medium | Dynamic Programming | |
96 | Unique Binary Search Trees | Python | Medium | Dynamic Programming |
Day 41 - Dynamic Programming Part 4
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
46 | 携带研究材料-2D/1D | Python | – | Dynamic Programming | |
416 | Partition Equal Subset Sum | Python | Medium | Dynamic Programming |
Day 43 - Dynamic Programming Part 5
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
1049 | Last Stone Weight II | Python | Medium | Dynamic Programming | |
494 | Target Sum | Python | Medium | Dynamic Programming | |
474 | Ones and Zeroes | Python | Medium | Dynamic Programming |
Day 44 - Dynamic Programming Part 6
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
518 | Coin Change II | Python | Medium | Dynamic Programming | |
377 | Combination Sum IV | Python | Medium | Dynamic Programming |
Day 45 - Dynamic Programming Part 7
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
70 | Climbing Stairs | Python | Easy | Dynamic Programming | |
57 | Advanced Climbing Stairs | Python | – | Dynamic Programming | |
322 | Coin Change | Python | Medium | Dynamic Programming | |
279 | Perfect Squares | Python | Medium | Dynamic Programming | |
amz | Amazon Warehouse Distribution | Python | – | Dynamic Programming |
Day 46 - Dynamic Programming Part 8
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
139 | Word Break | Python | Medium | Dynamic Programming | |
56 | Carrying Ore Resources | Python | – | Dynamic Programming | |
146 | LRU Cache | Python | Medium | Design |
Day 47 - Dynamic Programming Part 9
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
198 | House Robber | Python | Medium | Dynamic Programming | |
213 | House Robber II | Python | Medium | Dynamic Programming | |
337 | House Robber III | Python | Medium | Dynamic Programming |
Day 48 - Dynamic Programming Part 10
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
121 | Best Time to Buy and Sell Stock | Python | Easy | Dynamic Programming | |
122 | Best Time to Buy and Sell Stock II | Python | Medium | Dynamic Programming |
Day 50 - Dynamic Programming Part 11
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
123 | Best Time to Buy and Sell Stock III | Python | Hard | Dynamic Programming | |
188 | Best Time to Buy and Sell Stock IV | Python | Hard | Dynamic Programming |
Day 51 - Dynamic Programming Part 12
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
309 | Best Time to Buy and Sell Stock with Cooldown | Python | Medium | Dynamic Programming | |
714 | Best Time to Buy and Sell Stock with Transaction Fee | Python | Medium | Dynamic Programming |
Day 52 - Dynamic Programming Part 13
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
300 | Longest Increasing Subsequence | Python | Medium | Dynamic Programming | |
674 | Longest Continuous Increasing Subsequence | Python | Easy | Dynamic Programming | |
718 | Maximum Length of Repeated Subarray | Python | Medium | Dynamic Programming |
Day 53 - Dynamic Programming Part 14
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
1143 | Longest Common Subsequence | Python | Medium | Dynamic Programming | |
1035 | Uncrossed Lines | Python | Medium | Dynamic Programming | |
53 | Maximum Subarray | Python | Medium | Dynamic Programming |
Day 54 - Dynamic Programming Part 15
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
392 | Is Subsequence | Python | Easy | Dynamic Programming | |
115 | Distinct Subsequences | Python | Hard | Dynamic Programming |
Day 55 - Dynamic Programming Part 16
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
583 | Delete Operation for Two Strings | Python | Medium | Dynamic Programming | |
72 | Edit Distance | Python | Hard | Dynamic Programming |
Day 57 - Dynamic Programming Part 17
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
647 | Palindromic Substrings | Python | Medium | Dynamic Programming | |
516 | Longest Palindromic Subsequence | Python | Medium | Dynamic Programming |
Day 58 - Monotonic Stack Part 1
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
739 | Daily Temperatures | Python | Medium | Monotonic Stack | |
496 | Next Greater Element I | Python | Easy | Monotonic Stack |
Day 59 - Monotonic Stack Part 2
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
503 | Next Greater Element II | Python | Medium | Monotonic Stack | |
42 | Trapping Rain Water | Python | Hard | Monotonic Stack |
Day 60 - Monotonic Stack Part 3
Question# | Title | Solution | Difficulty | Topics | Notes |
---|---|---|---|---|---|
84 | Largest Rectangle in Histogram | Python | Hard | Monotonic Stack |