Showcasing my atrociously slow progress of plowing through leetcode questions in CPP.
To find my corresponding submission of a problem, simply search (ctrl+f) for the problem index.
| Array | |||||
|---|---|---|---|---|---|
| Number | Title | Init Date | Review Date | Special Notes | |
| 27 | Remove Element | 1/30 | 2/27 | V | |
| 35 | Search Insert Position | 1/31 | V | ||
| 66 | Plus One | 2/2 | |||
| 88 | Merge Sorted Array | 2/3 | V | ||
| 118 | Pascal's-Triangle | 2/4 | |||
| 122 | Best Time to Buy and Sell Stock II | 2/5 | |||
| 167 | Two Sum II - Input array is sorted | 2/6 | V | ||
| 217 | Contains-Duplicate | 2/7 | |||
| 1480 | Running Sum of 1d Array | 3/10 | |||
| 1431 | Kids With the Greatest Number of Candies | 3/10 | |||
| 1470 | Shuffle the Array | 3/10 | |||
| 414 | Third Maximum Number | 3/10 | sets | ||
| 1672 | Richest Customer Wealth | 3/12 | |||
| 724* | Find Pivot Index | 3/12 | cannot reset left, right | ||
| 1512 | Number of Good Pairs | 3/20 | |||
| 896 | Monotonic Array | 3/20 | |||
| 1365* | How Many Numbers Are Smaller Than the Current Number | 3/23 | Create lookup table O(n) | ||
| 1* | Two Sum | 3/23 | Unordered map and find() | ||
| 1773* | Count Items Matching a Rule | 3/24 | Lambda functions and count_if() | ||
| 1313* | Decompress Run-Length Encoded List | 3/25 | vector.insert() | ||
| 1389* | Create Target Array in the Given Order | 3/26 | vector.insert() or swap() | ||
| 1486 | XOR Operation in an Array | 3/28 | |||
| 1588 | Sum of All Odd Length Subarrays | 3/28 | |||
| 1534 | Count Good Triplets | 3/30 | |||
| 999 | Available Captures for Rook | 3/30 | |||
| 1732 | Find the Highest Altitude | 3/31 | |||
| 1266 | Minimum Time Visiting All Points | 3/31 | |||
| 1252 | Cells with Odd Values in a Matrix | 4/12 | |||
| 1295 | Find Numbers with Even Number of Digits | 4/12 | |||
| 832 | Flipping an Image | 4/12 | |||
| 463* | Island Perimeter | 4/16 | Perimeter math | ||
| 73* | Set Matrix Zeroes | 5/14 | O(1) Space (Last row) | ||
| 238* | Product of Array Except Self | 5/20 | O(n) Time (2 pointer) | ||
| 48* | Rotate Image | 6/9 | Rotation geometry | V | |
| 11* | Container With Most Water | 6/11 | 2 Pointers | ||
| 33* | Search in Rotated Sorted Array | 6/12 | 2 Pointers | V | |
| 3* | Longest Substring Without Repeating Characters | 6/28 | Sliding window | V | |
| 15* | 3Sum | 7/10 | 2 Pointers | V | |
| 16* | 3Sum Closet | 7/10 | 2 Pointers | V | |
| 18* | 4Sum | 7/10 | 2 Pointers | V | |
| 26* | Remove Duplicates from Sorted Array | 7/13 | 2 Pointers | V | |
| 80* | Remove Duplicates from Sorted Array II | 9/3 | 2 Pointers | V | |
| 136* | Single Number | 9/12 | XOR | V | |
| 162* | Find Peak Element | 9/18 | Binary Search | V | |
| 137* | Single Number II | 9/18 | Count sum of bits for each digit | V | |
| 155* | Min Stack | 9/15 | Stack of pairs | V | |
| 169* | Majority Element | 10/8 | Boyer-Moore voting algorithm | V |
| Hash | |||||
|---|---|---|---|---|---|
| Number | Title | Init Date | Review Date | Special Notes | |
| 771 | Jewels and Stones | 4/15 | |||
| 1748 | Sum of Unique Elements | 4/15 | |||
| 961 | N-Repeated Element in Size 2N Array | 4/16 | unordered_set | ||
| 1207 | Unique Number of Occurrences | 4/16 | uset + umap | ||
| 811* | Subdomain Visit Count | 4/16 | stoi, string::find() | ||
| 1002* | Find Common Characters | 4/16 | 2 Hash Tables (vector) | ||
| 347* | Top K Frequent Elements | 6/7 | bucket sort (reverse vector) | ||
| 49* | Group Anagrams | 7/22 | sort entry to place into bucket | V |
| List | |||||
|---|---|---|---|---|---|
| Number | Title | Init Date | Review Date | Special Notes | |
| 2 | Add Two Numbers | 2/8 | |||
| 24 | Swap Nodes in Pairs | 2/8 | 5/17 | Recursive | |
| 21 | Merge Two Sorted Lists | 2/9 | 2/28 | V | |
| 141 | Linked List Cycle | 2/10 | 2/28 | Fast + Slow | V |
| 23 | Merge K Sorted Lists | 3/10 | Priority Queue | V | |
| 206** | Reverse Linked List | 5/17 | Recursive/Graphical | V | |
| 148** | Sort List | 5/18 | Merge Sort Recursive | V | |
| 143* | Reorder List | 6/7 | Recursive | ||
| 19* | Remove Nth Node From End of List | 7/12 | Fast + Slow | V | |
| 82* | Remove Duplicates from Sorted List | 9/4 | V | ||
| 83* | Remove Duplicates from Sorted List II | 9/4 | V | ||
| 142* | Linked List Cycle II | 9/13 | Floyd's Algorithm | V |
| Tree | |||||
|---|---|---|---|---|---|
| Number | Title | Init Date | Review Date | Special Notes | |
| 94 | Binary Tree Inorder Traversal | 2/11 | 5/16 | ||
| 100 | Same Tree | 2/11 | Recursive | ||
| 101 | Symmetric Tree | 2/11 | Recursive | ||
| 102 | Binary Tree Level Order Traversal | 2/13 | BFS + queue | ||
| 107 | Binary Tree Level Order Traversal II | 2/13 | 5/14 | BFS + queue / DFS | |
| 872 | Leaf-Similar Trees | 2/13 | Recursive | ||
| 530 | Minimum Absolute Difference in BST | 2/17 | In-Order | ||
| 700 | Search in a Binary Search Tree | 2/18 | In-Order | ||
| 589* | N-ary Tree Preorder Traversal | 3/6 | Pre-Order + iterative stack | ||
| 938 | Range Sum of BST | 4/17 | In-Order | ||
| 617* | Merge Two Binary Trees | 4/18 | In-Order + new() | ||
| 897* | Increasing Order Search Tree | 4/19 | In-Order + new() | ||
| 1022* | Sum of Root To Leaf Binary Numbers | 4/19 | In-Order + pop sequence | ||
| 95* | Unique Binary Search Trees II | 5/16 | Recursive Solution | ||
| 208* | Implement Trie (Prefix Tree) | 9/19 | Recursive Struct (like AST) |
| DFS | |||||
|---|---|---|---|---|---|
| Number | Title | Init Date | Review Date | Special Notes | |
| 733* | Flood Fill | 2/15 | |||
| 547* | Number of Provinces | 2/16 | |||
| 841* | Keys and Rooms | 2/16 | |||
| 207* | Course Schedule | 2/17 | topological sort | ||
| 39* | Combination Sum | 2/22 | V | ||
| 687* | Longest Univalue Path | 5/2 | |||
| 104* | Maximum Depth of Binary Tree | 5/3 | |||
| 108* | Convert Sorted Array to Binary Search Tree | 5/4 | |||
| 114** | Flatten Binary Tree to Linked List | 5/6 | |||
| 257* | Binary Tree Paths | 5/10 | |||
| 199* | Binary Tree Right Side View | 5/11 | |||
| 491* | Increasing Subsequences | 5/12 | |||
| 109* | Convert Sorted List to Binary Search Tree | 5/14 | |||
| 128* | Longest Consecutive Sequence | 6/6 | unordered_set | ||
| 297* | Serialize and Deserialize Binary Tree | 6/6 | stringstream | ||
| 417* | Pacific Atlantic Water Flow | 6/13 | |||
| 17* | Letter Combinations of a Phone Number | 7/10 | V | ||
| 40* | Combination Sum II | 7/14 | V | ||
| 46* | Permutations | 7/21 | V | ||
| 78* | Subsets | 8/28 | V | ||
| 90* | Subsets II | 9/9 | V | ||
| 1239* | Maximum Length of a Concatenated String with Unique Characters | 9/26 | V |
| DP | |||||
|---|---|---|---|---|---|
| Number | Title | Init Date | Review Date | Special Notes | |
| 53* | Maximum Subarray | 2/1 | i = max(i*m, i) | V | |
| 121* | Best Time to Buy and Sell Stock I | 2/5 | |||
| 746* | Min Cost Climbing Stairs | 3/2 | i += i-1 + i-2 | ||
| 279* | Perfect Squares | 5/13 | min(i, i- JxJ) | ||
| 309* | Best Time to Buy and Sell Stock with Cooldown | 5/13 | FSM | ||
| 152* | Maximum Product Subarray | 6/14 | i = max(i*m, i) and swap | ||
| 5* | Longest Palindromic Substring | 6/30 | 4 patterns: a aa aba abba | V | |
| 55* | Jump Game | 7/26 | V | ||
| 62* | Unique Paths | 7/26 | V | ||
| 70* | Climbing Stairs | 7/27 | V |
| String | |||||
|---|---|---|---|---|---|
| Number | Title | Init Date | Review Date | Special Notes | |
| 22* | Generate Parentheses | 5/15 | Recursion | V | |
| 13* | Roman to Integer | 5/16 | Unordered Map | ||
| 20* | Valid Parentheses | 7/12 | Stack | V |
| Math | |||||
|---|---|---|---|---|---|
| Number | Title | Init Date | Review Date | Special Notes | |
| 7* | Reverse Integer | 6/30 | Overflow check | V | |
| 9* | Palindrome Number | 7/8 | V | ||
| 69* | Sqrt(x) | 7/27 | Binary Search | V | |
| 67* | Add Binary | 9/26 | V |
Total: 121
This page will be updated tentatively upon completion of solving more problems.
Last Update: 9/26/2021