Leetcode Solutions
Best Time to Buy and Sell Stock
Path Sum
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 112 | Path Sum | Easy | Path Sum | |
| 113 | Path Sum II | Medium | Path Sum II | |
| 437 | Path Sum III | Easy | Path Sum III |
House Robber
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 198 | House Robber | Easy | House Robber | dp |
| 213 | House Robber II | Easy | House Robber II | dp |
| 337 | House Robber III | Medium | House Robber III | dp |
Binary Tree Traversal
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 144 | Binary Tree Preorder Traversal | Medium | Binary Tree Preorder Traversal | |
| 94 | Binary Tree Inorder Traversal | Medium | Binary Tree Inorder Traversal | |
| 145 | Binary Tree Postorder Traversal | Hard | Binary Tree Postorder Traversal | |
| 102 | Binary Tree Level Order Traversal | Medium | Binary Tree Level Order Traversal | * Binary-Tree Traverse |
| 107 | Binary Tree Level Order Traversal II | Easy | Binary Tree Level Order Traversal II | * Binary-Tree Traverse |
Find Number Disappear or Duplicate in Array
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 41 | First Missing Positive | Hard | First Missing Positive | |
| 287 | Find the Duplicate Number | Medium | Find the Duplicate Number | fast-slow-pointer |
| 442 | Find All Duplicates in an Array | Medium | Find All Duplicates in an Array | |
| 448 | Find All Numbers Disappeared in an Array | Easy | Find All Numbers Disappeared in an Array | |
| 645 | Set Mismatch | Easy | Set Mismatch |
Water Container
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 11 | Container With Most Water | Medium | Container With Most Water | |
| 42 | Trapping Rain Water | Hard | Trapping Rain Water | Dp/Stack/Two Pointer |
| 407 | Trapping Rain Water II | Hard | Trapping Rain Water II |
Numbers represented by String
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 2 | Add Two Numbers | Medium | Add Two Numbers | |
| 66 | Plus One | Easy | Plus One | |
| 67 | Add Binary | Easy | Add Binary |
Palindrome
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 5 | Longest Palindromic Substring | Medium | Longest Palindromic Substring | dp & Manacher’s Algorithm * |
| 9 | Palindrome Number | Easy | Palindrome Number |
Integer and Roman
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 12 | Integer to Roman | Medium | Integer to Roman | |
| 13 | Roman to Integer | Easy | Roman to Integer |
N Sum
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 1 | Two Sum | Easy | Two Sum | |
| 15 | 3Sum | Medium | 3Sum | |
| 16 | 3Sum Closest | Medium | 3Sum Closest | |
| 18 | 4Sum | Medium | 4Sum |
Merge Sorted List
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 21 | Merge Two Sorted Lists | Easy | Merge Two Sorted Lists | |
| 23 | Merge k Sorted Lists | Hard | Merge k Sorted Lists | Divide Conquer & Heap Sort |
Search in Sorted Array
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 33 | Search in Rotated Sorted Array | Medium | Search in Rotated Sorted Array | |
| 34 | Find First and Last Position of Element in Sorted Array | Medium | Find First and Last Position of Element in Sorted Array | |
| 35 | Search Insert Position | Easy | Search Insert Position |
Sudoku
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 36 | Valid Sudoku | Medium | Valid Sudoku | |
| 37 | Sudoku Solver | Hard | Sudoku Solver | Backtracking * |
Longest Subsequence
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 300 | Longest Increasing Subsequence | Medium | Longest Increasing Subsequence | dp |
| 873 | Length of Longest Fibonacci Subsequence | Medium | Length of Longest Fibonacci Subsequence | dp |
Combination Sum
| # | Title | Difficulty | Blog | Others |
|---|---|---|---|---|
| 39 | Combination Sum | Medium | Combination Sum | backtracing |
| 40 | Combination Sum II | Medium | Combination Sum II | backtracing |
| 216 | Combination Sum III | Medium | Combination Sum III | backtracing |
| 377 | Combination Sum IV | Medium | Combination Sum IV | dp |