LeetCode Solution in Java
- Math
- Bit
- Array/String
- Linked List
- Hash Table
- Stack/Queue
- Tree
- Heap
- Graph
- Greedy
- Backtracking
- Divide and Conquer
- Dynamic Programming
- Trie
- Design
# | Title | Solution | Difficulty |
---|---|---|---|
8 | Reverse Integer | Java | Easy |
9 | Palindrome Number | Java | Easy |
43 | Multiply Strings (Classic) | Java | Medium |
50 | Pow(x, n) | Java | Medium |
66 | Plus One | Java | Easy |
67 | Add Binary | Java | Easy |
204 | Count Primes | Java | Easy |
415 | Add Strings | Java | Easy |
989 | Add to Array-Form of Integer | Java | Easy |
1232 | Check If It Is a Straight Line | Java | Easy |
# | Title | Solution | Difficulty |
---|---|---|---|
136 | Single Number | Java | Easy |
191 | Number of 1 Bits | Java | Easy |
231 | Power of Two | Java | Easy |
371 | Sum of Two Integers | Java | Medium |
461 | Hamming Distance | Java | Easy |
477 | Total Hamming Distance | Java | Medium |
# | Title | Solution | Difficulty |
---|---|---|---|
11 | Container With Most Water | Java | Medium |
26 | Remove Duplicates from Sorted Array | Java | Easy |
27 | Remove Element | Java | Easy |
80 | Remove Duplicates from Sorted Array II (Classic) | Java | Medium |
75 | Sort Colors | Java | Medium |
125 | Valid Palindrome | Java | Easy |
283 | Move Zeroes | Java | Easy |
344 | Reverse String | Java | Easy |
1119 | Remove Vowels from a String | Java | Easy |
# | Title | Solution | Difficulty |
---|---|---|---|
36 | Valid Sudoku | Java | Medium |
48 | Rotate Image (Classic) | Java | Medium |
54 | Spiral Matrix (Classic) | Java | Medium |
59 | Spiral Matrix II | Java | Medium |
73 | Set Matrix Zeroes (Classic) | Java | Medium |
74 | Search a 2D Matrix | Java | Medium |
240 | Search a 2D Matrix II | Java | Medium |
498 | Diagonal Traverse | Java | Medium |
867 | Transpose Matrix | Java | Easy |
# | Title | Solution | Difficulty |
---|---|---|---|
2 | Add Two Numbers | Java | Medium |
19 | Remove Nth Node From End of List | Java | Medium |
21 | Merge Two Sorted Lists | Java | Easy |
25 | Reverse Nodes in k-Group (Classic) | Java | Hard |
82 | Remove Duplicates from Sorted List II (Classic) | Java | Medium |
83 | Remove Duplicates from Sorted List (Classic) | Java | Easy |
138 | Copy List with Random Pointer (Classic) | Java | Medium |
141 | Linked List Cycle | Java | Easy |
142 | Linked List Cycle II | Java | Medium |
143 | Reorder List | Java | Medium |
147 | Insertion Sort List | Java | Medium |
148 | Sort List | Java | Medium |
160 | Intersection of Two Linked Lists | Java | Easy |
203 | Remove Linked List Elements | Java | Easy |
206 | Reverse Linked List | Java | Easy |
234 | Palindrome Linked List (Classic) | Java | Easy |
328 | Odd Even Linked List | Java | Medium |
445 | Add Two Numbers II | Java | Medium |
707 | Design Linked List | Java | Medium |
876 | Middle of the Linked List | Java | Easy |
1265 | Print Immutable Linked List in Reverse | Java | Easy |
# | Title | Solution | Difficulty |
---|---|---|---|
128 | Longest Consecutive Sequence | Java | Hard |
771 | Jewels and Stones | Java | Easy |
888 | Fair Candy Swap | Java | Easy |
# | Title | Solution | Difficulty |
---|---|---|---|
20 | Valid Parentheses | Java | Easy |
155 | Min Stack | Java | Easy |
225 | Implement Stack using Queues | Java | Easy |
232 | Implement Queue using Stacks | Java | Easy |
739 | Daily Temperatures | Java | Medium |
946 | Validate Stack Sequences (Classic) | Java | Medium |
1047 | Remove All Adjacent Duplicates In String | Java | Easy |
Important
# | Title | Solution | Difficulty |
---|---|---|---|
98 | Validate Binary Search Tree | Java | Medium |
100 | Same Tree | Java | Easy |
101 | Symmetric Tree | Java | Easy |
104 | Maximum Depth of Binary Tree | Java | Easy |
111 | Minimum Depth of Binary Tree | Java | Easy |
112 | Path Sum | Java | Easy |
114 | Flatten Binary Tree to Linked List | Java | Medium |
116 | Populating Next Right Pointers in Each Node | Java | Medium |
129 | Sum Root to Leaf Numbers | Java | Medium |
173 | Binary Search Tree Iterator | Java | Medium |
199 | Binary Tree Right Side View | Java | Medium |
222 | Count Complete Tree Nodes | Java | Medium |
226 | Invert Binary Tree | Java | Easy |
235 | Lowest Common Ancestor of a Binary Search Tree | Java | Easy |
236 | Lowest Common Ancestor of a Binary Tree | Java | Medium |
257 | Binary Tree Paths | Java | Easy |
297 | Serialize and Deserialize Binary Tree | Java | Hard |
653 | Two Sum IV - Input is a BST | Java | Easy |
# | Title | Solution | Difficulty |
---|---|---|---|
23 | Merge k Sorted Lists (Classic) | Java | Hard |
215 | Kth Largest Element in an Array | Java | Medium |
295 | Find Median from Data Stream (Classic) | Java | Hard |
703 | Kth Largest Element in a Stream | Java | Easy |
# | Title | Solution | Difficulty |
---|
# | Title | Solution | Difficulty |
---|---|---|---|
45 | Jump Game II | Java | Medium |
55 | Jump Game | Java | Medium |
# | Title | Solution | Difficulty |
---|---|---|---|
17 | Letter Combinations of a Phone Number | Java | Medium |
22 | Generate Parentheses | Java | Medium |
39 | Sudoku Solver (Classic) | Java | Hard |
39 | Combination Sum | Java | Medium |
40 | Combination Sum II (Classic) | Java | Medium |
46 | Permutations | Java | Medium |
47 | Permutations II (Classic) | Java | Medium |
51 | N-Queens (Classic) | Java | Hard |
77 | Combinations | Java | Medium |
78 | Subsets | Java | Medium |
90 | Subsets II (Classic) | Java | Medium |
93 | Restore IP Addresses (Classic) | Java | Medium |
113 | Path Sum II | Java | Medium |
216 | Combination Sum III | Java | Medium |
437 | Path Sum III | Java | Medium |
# | Title | Solution | Difficulty |
---|---|---|---|
69 | Sqrt(x) | Java | Easy |
493 | Reverse Pairs (Classic) | Java | Hard |
1539 | Kth Missing Positive Number (Classic) | Java | Easy |
Important
# | Title | Solution | Difficulty |
---|---|---|---|
208 | Implement Trie (Prefix Tree) | Java | Medium |
# | Title | Solution | Difficulty |
---|---|---|---|
1244 | Design A Leaderboard | Java | Medium |
1396 | Design Underground System | Java | Medium |