My LeetCode Solutions!
Contributions are very welcome!
If you see an problem that you'd like to see fixed, the best way to make it happen is to help out by submitting a pull request implementing it. Refer to the CONTRIBUTING.md file for more details about the workflow.
You can also ask for problem solving ideas and discuss in GitHub issues directly.
- Learn
- Interview
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 14 | Longest Common Prefix | Java & Python | ![]() |
Introduction to String |
| 26 | Remove Duplicates from Sorted Array | Java & Python | ![]() |
Conclusion |
| 27 | Remove Element | Java & Python | ![]() |
Two-Pointer Technique |
| 28 | Implement strStr() | Java & Python | ![]() |
Introduction to String |
| 54 | Spiral Matrix | Java & Python | ![]() |
Introduction to 2D Array |
| 66 | Plus One | Java & Python | ![]() |
Introduction to Array |
| 67 | Add Binary | Java & Python | ![]() |
Introduction to String |
| 118 | Pascal's Triangle | Java & Python | ![]() |
Introduction to 2D Array |
| 119 | Pascal's Triangle II | Java & Python | ![]() |
Conclusion |
| 151 | Reverse Words in a String | Java & Python | ![]() |
Conclusion |
| 167 | Two Sum II - Input array is sorted | Java & Python | ![]() |
Two-Pointer Technique |
| 189 | Rotate Array | Java & Python | ![]() |
Conclusion |
| 209 | Minimum Size Subarray Sum | Java & Python | ![]() |
Two-Pointer Technique |
| 283 | Move Zeroes | Java & Python | ![]() |
Conclusion |
| 344 | Reverse String | Java & Python | ![]() |
Two-Pointer Technique |
| 485 | Max Consecutive Ones | Java & Python | ![]() |
Two-Pointer Technique |
| 498 | Diagonal Traverse | Java & Python | ![]() |
Introduction to 2D Array |
| 557 | Reverse Words in a String III | Java & Python | ![]() |
Conclusion |
| 561 | Array Partition I | Java & Python | ![]() |
Two-Pointer Technique |
| 724 | Find Pivot Index | Java & Python | ![]() |
Introduction to Array |
| 747 | Largest Number Greater Than Twice of Others | Java & Python | ![]() |
Introduction to Array |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 20 | Valid Parentheses | Java & Python | ![]() |
Stack: Last-in-first-out Data Structure |
| 133 | Clone Graph | Java & Python | ![]() |
Stack and DFS |
| 150 | Evaluate Reverse Polish Notation | Java & Python | ![]() |
Stack: Last-in-first-out Data Structure |
| 155 | Min Stack | Java & Python | ![]() |
Stack: Last-in-first-out Data Structure |
| 200 | Number of Islands | Java & Python | ![]() |
Queue and BFS |
| 225 | Implement Stack using Queues | Java & Python | ![]() |
Conclusion |
| 232 | Implement Queue using Stacks | Java & Python | ![]() |
Conclusion |
| 279 | Perfect Squares | Java & Python | ![]() |
Queue and BFS |
| 394 | Decode String | Java & Python | ![]() |
Conclusion |
| 494 | Target Sum | Java & Python | ![]() |
Stack and DFS |
| 542 | 01 Matrix | Java & Python | ![]() |
Conclusion |
| 622 | Design Circular Queue | Java & Python | ![]() |
Queue: First-in-first-out Data Structure |
| 733 | Flood Fill | Java & Python | ![]() |
Conclusion |
| 739 | Daily Temperatures | Java & Python | ![]() |
Stack: Last-in-first-out Data Structure |
| 752 | Open the Lock | Java & Python | ![]() |
Queue and BFS |
| 841 | Keys and Rooms | Java & Python | ![]() |
Conclusion |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 2 | Add Two Numbers | Java & Python | ![]() |
Conclusion |
| 19 | Remove Nth Node From End of List | Java & Python | ![]() |
Two Pointer Technique |
| 21 | Merge Two Sorted Lists | Java & Python | ![]() |
Conclusion |
| 61 | Rotate List | Java & Python | ![]() |
Conclusion |
| 135 | Copy List with Random Pointer | Java & Python | ![]() |
Conclusion |
| 141 | Linked List Cycle | Java & Python | ![]() |
Two Pointer Technique |
| 142 | Linked List Cycle II | Java & Python | ![]() |
Two Pointer Technique |
| 160 | Intersection of Two Linked Lists | Java & Python | ![]() |
Two Pointer Technique |
| 203 | Remove Linked List Elements | Java & Python | ![]() |
Classic Problems |
| 206 | Reverse Linked List | Java & Python | ![]() |
Classic Problems |
| 234 | Palindrome Linked List | Java & Python | ![]() |
Classic Problems |
| 328 | Odd Even Linked List | Java & Python | ![]() |
Classic Problems |
| 430 | Flatten a Multilevel Doubly Linked List | Java & Python | ![]() |
Conclusion |
| 707 | Design Linked List | Java & Python | ![]() |
Singly Linked List |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 1 | Two Sum | Java & Python | ![]() |
Practical Application - Hash Map |
| 3 | Longest Substring Without Repeating Characters | Java & Python | ![]() |
Conclusion |
| 36 | Valid Sudoku | Java & Python | ![]() |
Practical Application - Design the Key |
| 49 | Group Anagrams | Java & Python | ![]() |
Practical Application - Design the Key |
| 136 | Single Number | Java & Python | ![]() |
Practical Application - Hash Set |
| 202 | Happy Number | Java & Python | ![]() |
Practical Application - Hash Set |
| 205 | Isomorphic Strings | Java & Python | ![]() |
Practical Application - Hash Map |
| 217 | Contains Duplicate | Java & Python | ![]() |
Practical Application - Hash Set |
| 219 | Contains Duplicate II | Java & Python | ![]() |
Practical Application - Hash Map |
| 347 | Top K Frequent Elements | Java & Python | ![]() |
Conclusion |
| 349 | Intersection of Two Arrays | Java & Python | ![]() |
Practical Application - Hash Set |
| 350 | Intersection of Two Arrays II | Java & Python | ![]() |
Practical Application - Hash Map |
| 380 | Insert Delete GetRandom O(1) | Java & Python | ![]() |
Conclusion |
| 387 | First Unique Character in a String | Java & Python | ![]() |
Practical Application - Hash Map |
| 454 | 4Sum II | Java & Python | ![]() |
Conclusion |
| 599 | Minimum Index Sum of Two Lists | Java & Python | ![]() |
Practical Application - Hash Map |
| 652 | Find Duplicate Subtrees | Java & Python | ![]() |
Practical Application - Design the Key |
| 705 | Design HashSet | Java & Python | ![]() |
Design a Hash Table |
| 706 | Design HashMap | Java & Python | ![]() |
Design a Hash Table |
| 771 | Jewels and Stones | Java & Python | ![]() |
Conclusion |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 94 | Binary Tree Inorder Traversal | Java & Python | ![]() |
Traverse A Tree |
| 101 | Symmetric Tree | Java & Python | ![]() |
Solve Tree Problems Recursively |
| 102 | Binary Tree Level Order Traversal | Java & Python | ![]() |
Traverse A Tree |
| 104 | Maximum Depth of Binary Tree | Java & Python | ![]() |
Solve Tree Problems Recursively |
| 105 | Construct Binary Tree from Preorder and Inorder Traversal | Java & Python | ![]() |
Conclusion |
| 106 | Construct Binary Tree from Inorder and Postorder Traversal | Java & Python | ![]() |
Conclusion |
| 112 | Path Sum | Java & Python | ![]() |
Solve Tree Problems Recursively |
| 116 | Populating Next Right Pointers in Each Node | Java & Python | ![]() |
Conclusion |
| 117 | Populating Next Right Pointers in Each Node II | Java & Python | ![]() |
Conclusion |
| 144 | Binary Tree Preorder Traversal | Java & Python | ![]() |
Traverse A Tree |
| 145 | Binary Tree Postorder Traversal | Java & Python | ![]() |
Traverse A Tree |
| 236 | Lowest Common Ancestor of a Binary Tree | Java & Python | ![]() |
Conclusion |
| 297 | Serialize and Deserialize Binary Tree | Java & Python | ![]() |
Conclusion |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 98 | Validate Binary Search Tree | Java & Python | ![]() |
Introduction to BST |
| 108 | Convert Sorted Array to Binary Search Tree | Java & Python | ![]() |
Appendix: Height-balanced BST |
| 110 | Balanced Binary Tree | Java & Python | ![]() |
Appendix: Height-balanced BST |
| 173 | Binary Search Tree Iterator | Java & Python | ![]() |
Introduction to BST |
| 220 | Contains Duplicate III | Java & Python | ![]() |
Conclusion |
| 235 | Lowest Common Ancestor of a Binary Search Tree | Java & Python | ![]() |
Conclusion |
| 450 | Delete Node in a BST | Java & Python | ![]() |
Basic Operations in BST |
| 700 | Search in a Binary Search Tree | Java & Python | ![]() |
Basic Operations in BST |
| 701 | Insert into a Binary Search Tree | Java & Python | ![]() |
Basic Operations in BST |
| 703 | Kth Largest Element in a Stream | Java & Python | ![]() |
Conclusion |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 429 | N-ary Tree Level Order Traversal | Java & Python | ![]() |
Traversal |
| 559 | Maximum Depth of N-ary Tree | Java & Python | ![]() |
Recursion |
| 589 | N-ary Tree Preorder Traversal | Java & Python | ![]() |
Traversal |
| 590 | N-ary Tree Postorder Traversal | Java & Python | ![]() |
Traversal |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 208 | Implement Trie (Prefix Tree) | Java & Python | ![]() |
Basic Operations |
| 211 | Add and Search Word - Data structure design | Java & Python | ![]() |
Practical Application I |
| 212 | Word Search II | Java & Python | ![]() |
Practical Application II |
| 336 | Palindrome Pairs | Java & Python | ![]() |
Practical Application II |
| 421 | Maximum XOR of Two Numbers in an Array | Java & Python | ![]() |
Practical Application II |
| 648 | Replace Words | Java & Python | ![]() |
Practical Application I |
| 677 | Map Sum Pairs | Java & Python | ![]() |
Practical Application I |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| ### | Calculate Entropy | Java & Python | ![]() |
Implementation |
| ### | Calculate Maximum Information Gain | Java & Python | ![]() |
Implementation |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 21 | Merge Two Sorted Lists | Java & Python | ![]() |
Conclusion |
| 24 | Swap Nodes in Pairs | Java & Python | ![]() |
Principle of Recursion |
| 50 | Pow(x, n) | Java & Python | ![]() |
Complexity Analysis |
| 70 | Climbing Stairs | Java & Python | ![]() |
Memoization |
| 95 | Unique Binary Search Trees II | Java & Python | ![]() |
Conclusion |
| 104 | Maximum Depth of Binary Tree | Java & Python | ![]() |
Complexity Analysis |
| 118 | Pascal's Triangle | Java & Python | ![]() |
Recurrence Relation |
| 119 | Pascal's Triangle II | Java & Python | ![]() |
Recurrence Relation |
| 206 | Reverse Linked List | Java & Python | ![]() |
Recurrence Relation |
| 344 | Reverse String | Java & Python | ![]() |
Principle of Recursion |
| 509 | Fibonacci Number | Java & Python | ![]() |
Memoization |
| 779 | K-th Symbol in Grammar | Java & Python | ![]() |
Conclusion |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 17 | Letter Combinations of a Phone Number | Java & Python | ![]() |
Conclusion |
| 22 | Generate Parentheses | Java & Python | ![]() |
Recursion to Iteration |
| 37 | Sudoku Solver | Java & Python | ![]() |
Backtracking |
| 46 | Permutations | Java & Python | ![]() |
Conclusion |
| 52 | N-Queens II | Java & Python | ![]() |
Backtracking |
| 77 | Combinations | Java & Python | ![]() |
Backtracking |
| 84 | Largest Rectangle in Histogram | Java & Python | ![]() |
Conclusion |
| 94 | Binary Tree Inorder Traversal | Java & Python | ![]() |
Recursion to Iteration |
| 98 | Validate Binary Search Tree | Java & Python | ![]() |
Divide and Conquer |
| 100 | Same Tree | Java & Python | ![]() |
Recursion to Iteration |
| 102 | Binary Tree Level Order Traversal | Java & Python | ![]() |
Recursion to Iteration |
| 218 | The Skyline Problem | Java & Python | ![]() |
Conclusion |
| 240 | Search a 2D Matrix II | Java & Python | ![]() |
Divide and Conquer |
| 912 | Sort an Array | Java & Python | ![]() |
Divide and Conquer |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 1114 | Print in Order | Java & Python | ![]() |
Concurrency |
| 1115 | Print FooBar Alternately | Java & Python | ![]() |
Concurrency |
| 1116 | Print Zero Even Odd | Java & Python | ![]() |
Concurrency |
| 1117 | Building H2O | Java & Python | ![]() |
Concurrency |
| 1195 | Fizz Buzz Multithreaded | Java & Python | ![]() |
Concurrency |
| 1226 | The Dining Philosophers | Java & Python | ![]() |
Concurrency |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 192 | Word Frequency | bash | ![]() |
Shell |
| 193 | Valid Phone Numbers | bash | ![]() |
Shell |
| 194 | Transpose File | bash | ![]() |
Shell |
| 195 | Tenth Line | bash | ![]() |
Shell |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 175 | Combine Two Tables | MySQL | ![]() |
Database |
| 176 | Second Highest Salary | MySQL | ![]() |
Database |
| 177 | Nth Highest Salary | MySQL | ![]() |
Database |
| 178 | Rank Scores | MySQL | ![]() |
Database |
| 180 | Consecutive Numbers | MySQL | ![]() |
Database |
| 181 | Employees Earning More Than Their Managers | MySQL | ![]() |
Database |
| 182 | Duplicate Emails | MySQL | ![]() |
Database |
| 183 | Customers Who Never Order | MySQL | ![]() |
Database |
| 184 | Department Highest Salary | MySQL | ![]() |
Database |
| 185 | Department Top Three Salaries | MySQL | ![]() |
Database |
| 196 | Delete Duplicate Emails | MySQL | ![]() |
Database |
| 197 | Rising Temperature | MySQL | ![]() |
Database |
| 262 | Trips and Users | MySQL | ![]() |
Database |
| 595 | Big Countries | MySQL | ![]() |
Database |
| 596 | Classes More Than 5 Students | MySQL | ![]() |
Database |
| 601 | Human Traffic of Stadium | MySQL | ![]() |
Database |
| 620 | Not Boring Movies | MySQL | ![]() |
Database |
| 626 | Exchange Seats | MySQL | ![]() |
Database |
| 627 | Swap Salary | MySQL | ![]() |
Database |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| Sort 1 | Bubble Sort | Java & Python | ![]() |
Sort Algorithm |
| Sort 2 | Insert Sort | Java & Python | ![]() |
Sort Algorithm |
| Sort 3 | Select Sort | Java & Python | ![]() |
Sort Algorithm |
| Sort 4 | Quick Sort | Java & Python | ![]() |
Sort Algorithm |
| Sort 5 | Merge Sort | Java & Python | ![]() |
Sort Algorithm |
| Sort 6 | Heap Sort | Java & Python | ![]() |
Sort Algorithm |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| Search 1 | Binary Search | Java & Python | ![]() |
Search Algorithm |
| Search 2 | Interpolation Search | Java & Python | ![]() |
Search Algorithmx |
| Search 3 | Order Search | Java & Python | ![]() |
Search Algorithm |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 1 | Two Sum | Java & Python | ![]() |
Array |
| 7 | Reverse Integer | Java & Python | ![]() |
Strings |
| 8 | String to Integer (atoi) | Java & Python | ![]() |
Strings |
| 13 | Roman to Integer | Java & Python | ![]() |
Math |
| 14 | Longest Common Prefix | Java & Python | ![]() |
Strings |
| 19 | Remove Nth Node From End of List | Java & Python | ![]() |
Linked List |
| 20 | Valid Parentheses | Java & Python | ![]() |
Others |
| 21 | Merge Two Sorted Lists | Java & Python | ![]() |
Linked List |
| 26 | Remove Duplicates from Sorted Array | Java & Python | ![]() |
Array |
| 28 | Implement strStr() | Java & Python | ![]() |
Strings |
| 36 | Valid Sudoku | Java & Python | ![]() |
Array |
| 38 | Count and Say | Java & Python | ![]() |
Strings |
| 48 | Rotate Image | Java & Python | ![]() |
Array |
| 53 | Maximum Subarray | Java & Python | ![]() |
Dynamic Programming |
| 66 | Plus One | Java & Python | ![]() |
Array |
| 70 | Climbing Stairs | Java & Python | ![]() |
Dynamic Programming |
| 88 | Merge Sorted Array | Java & Python | ![]() |
Sorting and Searching |
| 98 | Validate Binary Search Tree | Java & Python | ![]() |
Trees |
| 101 | Symmetric Tree | Java & Python | ![]() |
Trees |
| 102 | Binary Tree Level Order Traversal | Java & Python | ![]() |
Trees |
| 104 | Maximum Depth of Binary Tree | Java & Python | ![]() |
Trees |
| 108 | Convert Sorted Array to Binary Search Tree | Java & Python | ![]() |
Trees |
| 118 | Pascal's Triangle | Java & Python | ![]() |
Others |
| 121 | Best Time to Buy and Sell Stock | Java & Python | ![]() |
Dynamic Programming |
| 122 | Remove Duplicates from Sorted Array | Java & Python | ![]() |
Array |
| 125 | Valid Palindrome | Java & Python | ![]() |
Strings |
| 136 | Single Number | Java & Python | ![]() |
Array |
| 141 | Linked List Cycle | Java & Python | ![]() |
Linked List |
| 155 | Min Stack | Java & Python | ![]() |
Design |
| 189 | Rotate Array | Java & Python | ![]() |
Array |
| 190 | Reverse Bits | Java & Python | ![]() |
Others |
| 191 | Number of 1 Bits | Java & Python | ![]() |
Others |
| 198 | House Robber | Java & Python | ![]() |
Dynamic Programming |
| 204 | Count Primes | Java & Python | ![]() |
Math |
| 206 | Reverse Linked List | Java & Python | ![]() |
Linked List |
| 217 | Contains Duplicate | Java & Python | ![]() |
Array |
| 234 | Palindrome Linked List | Java & Python | ![]() |
Linked List |
| 237 | Delete Node in a Linked List | Java & Python | ![]() |
Linked List |
| 242 | Valid Anagram | Java & Python | ![]() |
Strings |
| 268 | Missing Number | Java & Python | ![]() |
Others |
| 278 | First Bad Version | Java & Python | ![]() |
Sorting and Searching |
| 283 | Move Zeroes | Java & Python | ![]() |
Array |
| 326 | Power of Three | Java & Python | ![]() |
Math |
| 344 | Reverse String | Java & Python | ![]() |
Strings |
| 350 | Intersection of Two Arrays II | Java & Python | ![]() |
Array |
| 384 | Shuffle an Array | Java & Python | ![]() |
Design |
| 387 | First Unique Character in a String | Java & Python | ![]() |
Strings |
| 412 | Fizz Buzz | Java & Python | ![]() |
Math |
| 461 | Hamming Distance | Java & Python | ![]() |
Others |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 2 | Add Two Numbers | Java & Python | ![]() |
Linked List |
| 3 | Longest Substring Without Repeating Characters | Java & Python | ![]() |
Array and Strings |
| 5 | Longest Palindromic Substring | Java & Python | ![]() |
Array and Strings |
| 15 | 3Sum | Java & Python | ![]() |
Array and Strings |
| 17 | Letter Combinations of a Phone Number | Java & Python | ![]() |
Backtracking |
| 22 | Generate Parentheses | Java & Python | ![]() |
Backtracking |
| 29 | Divide Two Integers | Java & Python | ![]() |
Math |
| 33 | Search in Rotated Sorted Array | Java & Python | ![]() |
Sorting and Searching |
| 34 | Find First and Last Position of Element in Sorted Array | Java & Python | ![]() |
Sorting and Searching |
| 46 | Permutations | Java & Python | ![]() |
Backtracking |
| 49 | Group Anagrams | Java & Python | ![]() |
Array and Strings |
| 50 | Pow(x, n) | Java & Python | ![]() |
Math |
| 55 | Jump Game | Java & Python | ![]() |
Dynamic Programming |
| 56 | Merge Intervals | Java & Python | ![]() |
Sorting and Searching |
| 62 | Unique Paths | Java & Python | ![]() |
Dynamic Programming |
| 69 | Sqrt(x) | Java & Python | ![]() |
Math |
| 73 | Set Matrix Zeroes | Java & Python | ![]() |
Array and Strings |
| 75 | Sort Colors | Java & Python | ![]() |
Sorting and Searching |
| 78 | Subsets | Java & Python | ![]() |
Backtracking |
| 79 | Word Search | Java & Python | ![]() |
Backtracking |
| 94 | Binary Tree Inorder Traversal | Java & Python | ![]() |
Trees and Graphs |
| 103 | Binary Tree Zigzag Level Order Traversal | Java & Python | ![]() |
Trees and Graphs |
| 105 | Construct Binary Tree from Preorder and Inorder Traversal | Java & Python | ![]() |
Trees and Graphs |
| 116 | Populating Next Right Pointers in Each Node | Java & Python | ![]() |
Trees and Graphs |
| 150 | Evaluate Reverse Polish Notation | Java & Python | ![]() |
Others |
| 160 | Intersection of Two Linked Lists | Java & Python | ![]() |
Linked List |
| 162 | Find Peak Element | Java & Python | ![]() |
Sorting and Searching |
| 166 | Fraction to Recurring Decimal | Java & Python | ![]() |
Math |
| 169 | Majority Element | Java & Python | ![]() |
Others |
| 171 | Excel Sheet Column Number | Java & Python | ![]() |
Math |
| 172 | Factorial Trailing Zeroes | Java & Python | ![]() |
Math |
| 200 | Number of Islands | Java & Python | ![]() |
Trees and Graphs |
| 202 | Happy Number | Java & Python | ![]() |
Math |
| 215 | Kth Largest Element in an Array | Java & Python | ![]() |
Sorting and Searching |
| 230 | Kth Smallest Element in a BST | Java & Python | ![]() |
Trees and Graphs |
| 240 | Search a 2D Matrix II | Java & Python | ![]() |
Sorting and Searching |
| 297 | Serialize and Deserialize Binary Tree | Java & Python | ![]() |
Design |
| 300 | Longest Increasing Subsequence | Java & Python | ![]() |
Dynamic Programming |
| 322 | Coin Change | Java & Python | ![]() |
Dynamic Programming |
| 328 | Odd Even Linked List | Java & Python | ![]() |
Linked List |
| 334 | Increasing Triplet Subsequence | Java & Python | ![]() |
Array and Strings |
| 347 | Top K Frequent Elements | Java & Python | ![]() |
Sorting and Searching |
| 371 | Sum of Two Integers | Java & Python | ![]() |
Others |
| 380 | Insert Delete GetRandom O(1) | Java & Python | ![]() |
Design |
| 621 | Task Scheduler | Java & Python | ![]() |
Others |
| # | Title | Solutions | Difficulty | Tag |
|---|---|---|---|---|
| 4 | Median of Two Sorted Arrays | Java & Python | ![]() |
Sorting and Searching |
| 10 | Regular Expression Matching | Java & Python | ![]() |
Backtracking |
| 11 | Container With Most Water | Java & Python | ![]() |
Array and Strings |
| 23 | Merge k Sorted Lists | Java & Python | ![]() |
Linked List |
| 41 | First Missing Positive | Java & Python | ![]() |
Array and Strings |
| 42 | Trapping Rain Water | Java & Python | ![]() |
Others |
| 44 | Wildcard Matching | Java & Python | ![]() |
Backtracking |
| 54 | Spiral Matrix | Java & Python | ![]() |
Array and Strings |
| 76 | Minimum Window Substring | Java & Python | ![]() |
Array and Strings |
| 84 | Largest Rectangle in Histogram | Java & Python | ![]() |
Others |
| 91 | Decode Ways | Java & Python | ![]() |
Dynamic Programming |
| 124 | Binary Tree Maximum Path Sum | Java & Python | ![]() |
Trees and Graphs |
| 127 | Word Ladder | Java & Python | ![]() |
Trees and Graphs |
| 128 | Longest Consecutive Sequence | Java & Python | ![]() |
Array and Strings |
| 130 | Surrounded Regions | Java & Python | ![]() |
Trees and Graphs |
| 131 | Palindrome Partitioning | Java & Python | ![]() |
Backtracking |
| 135 | Copy List with Random Pointer | Java & Python | ![]() |
Linked List |
| 139 | Word Break | Java & Python | ![]() |
Dynamic Programming |
| 140 | Word Break II | Java & Python | ![]() |
Dynamic Programming |
| 146 | LRU Cache | Java & Python | ![]() |
Design |
| 148 | Sort List | Java & Python | ![]() |
Linked List |
| 149 | Max Points on a Line | Java & Python | ![]() |
Math |
| 152 | Maximum Product Subarray | Java & Python | ![]() |
Dynamic Programming |
| 179 | Largest Number | Java & Python | ![]() |
Math |
| 207 | Course Schedule | Java & Python | ![]() |
Trees and Graphs |
| 208 | Implement Trie (Prefix Tree) | Java & Python | ![]() |
Design |
| 210 | Course Schedule II | Java & Python | ![]() |
Trees and Graphs |
| 212 | Word Search II | Java & Python | ![]() |
Backtracing |
| 218 | The Skyline Problem | Java & Python | ![]() |
Others |
| 227 | Basic Calculator II | Java & Python | ![]() |
Array and Strings |
| 236 | Lowest Common Ancestor of a Binary Tree | Java & Python | ![]() |
Trees and Graphs |
| 238 | Product of Array Except Self | Java & Python | ![]() |
Array and Strings |
| 239 | Sliding Window Maximum | Java & Python | ![]() |
Array and Strings |
| 279 | Perfect Squares | Java & Python | ![]() |
Dynamic Programming |
| 287 | Find the Duplicate Number | Java & Python | ![]() |
Array and Strings |
| 289 | Game of Life | Java & Python | ![]() |
Array and Strings |
| 295 | Find Median from Data Stream | Java & Python | ![]() |
Design |
| 301 | Remove Invalid Parentheses | Java & Python | ![]() |
Backtracking |
| 309 | Best Time to Buy and Sell Stock with Cooldown | Java & Python | ![]() |
Dynamic Programming |
| 312 | Burst Balloons | Java & Python | ![]() |
Dynamic Programming |
| 315 | Count of Smaller Numbers After Self | Java & Python | ![]() |
Trees and Graphs |
| 324 | Wiggle Sort II | Java & Python | ![]() |
Sorting and Searching |
| 329 | Longest Increasing Path in a Matrix | Java & Python | ![]() |
Trees and Graphs |
| 341 | Flatten Nested List Iterator | Java & Python | ![]() |
Design |
| 378 | Kth Smallest Element in a Sorted Matrix | Java & Python | ![]() |
Sorting and Searching |
| 406 | Queue Reconstruction by Height | Java & Python | ![]() |
Others |
| 454 | 4Sum II | Java & Python | ![]() |
Array and Strings |
| 547 | Friend Circles | Java & Python | ![]() |
Trees and Graphs |


