###Two Pointers
(Notes: "♥" means you need to buy a book from Leetcode)
###Hash Table
(Notes: "♥" means you need to buy a book from Leetcode)
###Linked List
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
2 | Add Two Numbers | C++ | Medium |
19 | Remove Nth Node From End of List | C++ | Easy |
21 | Merge Two Sorted Lists | C++ | Easy |
23 | Merge k Sorted Lists | C++ | Hard |
24 | Swap Nodes in Pairs | C++ | Easy |
25 | Reverse Nodes in k-Group | C++ | Hard |
61 | Rotate List | C++ | Easy |
82 | Remove Duplicates from Sorted List II | C++ | Medium |
83 | Remove Duplicates from Sorted List | C++ | Easy |
86 | Partition List | C++ | Medium |
92 | Reverse Linked List II | C++ | Medium |
109 | Convert Sorted List to Binary Search Tree | C++ | Medium |
138 | Copy List with Random Pointer | C++ | Hard |
141 | Linked List Cycle | C++ | Easy |
142 | Linked List Cycle II | C++ | Medium |
143 | Reorder List | C++ | Medium |
147 | Insertion Sort List | C++ | Medium |
148 | Sort List | C++ | Medium |
160 | Intersection of Two Linked Lists | C++ | Easy |
203 | Remove Linked List Elements | C++ | Easy |
206 | Reverse Linked List | C++ | Easy |
234 | Palindrome Linked List | C++ | Easy |
237 | Delete Node in a Linked List | C++ | Easy |
328 | Odd Even Linked List | C++ | Medium |
445 | Add Two Numbers II | C++ | Medium |
###Math
(Notes: "♥" means you need to buy a book from Leetcode)
###Array
(Notes: "♥" means you need to buy a book from Leetcode)
###String
(Notes: "♥" means you need to buy a book from Leetcode)
###Divide and Conquer
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
4 | Median of Two Sorted Arrays | C++ | Hard |
23 | Merge k Sorted Lists | C++ | Hard |
53 | Maximum Subarray | C++ | Medium |
169 | Majority Element | C++ | Easy |
215 | Kth Largest Element in an Array | C++ | Medium |
218 | The Skyline Problem | C++ | Hard |
240 | Search a 2D Matrix II | C++ | Medium |
###Binary Search
(Notes: "♥" means you need to buy a book from Leetcode)
###Dynamic Programming
(Notes: "♥" means you need to buy a book from Leetcode)
###Backtracking
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
17 | Letter Combinations of a Phone Number | C++ | Medium |
22 | Generate Parentheses | C++ | Medium |
37 | Sudoku Solver | C++ | Hard |
39 | Combination Sum | C++ | Medium |
40 | Combination Sum II | C++ | Medium |
46 | Permutations | C++ | Medium |
47 | Permutations II | C++ | Medium |
51 | N-Queens | C++ | Hard |
52 | N-Queens II | C++ | Hard |
60 | Permutation Sequence | C++ | Medium |
77 | Combinations | C++ | Medium |
78 | Subsets | C++ | Medium |
79 | Word Search | C++ | Medium |
89 | Gray Code | C++ | Medium |
90 | Subsets_II | C++ | Medium |
93 | Restore IP Addresses | C++ | Medium |
131 | Palindrome Partitioning | C++ | Medium |
211 | Add and Search Word - Data structure design | C++ | Medium |
216 | Combination Sum III | C++ | Medium |
357 | Count Numbers with Unique Digits | C++ | Medium |
401 | Binary Watch | C++ | Easy |
###Stack
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
20 | Valid Parentheses | C++ | Easy |
42 | Trapping Rain Water | C++ | Hard |
71 | Simplify Path | C++ | Hard |
84 | Largest Rectangle in Histogram | C++ | Hard |
85 | Maximal Rectangle | C++ | Hard |
94 | Binary Tree Inorder Traversal | C++ | Medium |
103 | Binary Tree Zigzag Level Order Traversal | C++ | Medium |
144 | Binary Tree Preorder Traversal | C++ | Medium |
145 | Binary Tree Postorder Traversal | C++ | Hard |
150 | Evaluate Reverse Polish Notation | C++ | Medium |
155 | Min Stack | C++ | Easy |
173 | Binary Search Tree Iterator | C++ | Medium |
225 | Implement Stack using Queues | C++ | Easy |
232 | Implement Queue using Stacks | C++ | Easy |
272 | Closest Binary Search Tree Value II | C++ | Hard |
316 | Remove Duplicate Letters | C++ | Hard |
331 | Verify Preorder Serialization of a Binary Tree | C++ | Medium |
341 | Flatten Nested List Iterator | C++ | Medium |
394 | Decode String | C++ | Medium |
402 | Remove K Digits | C++ | Medium |
456 | 132 Pattern | C++ | Medium |
###Heap
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
23 | Merge k Sorted Lists | C++ | Hard |
215 | Kth Largest Element in an Array | C++ | Medium |
218 | The Skyline Problem | C++ | Hard |
239 | Sliding Window Maximum | C++ | Hard |
264 | Ugly Number II | C++ | Medium |
313 | Super Ugly Number | C++ | Medium |
347 | Top K Frequent Elements | C++ | Medium |
373 | Find K Pairs with Smallest Sums | C++ | Medium |
451 | Sort Characters By Frequency | C++ | Medium |
###Greedy
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
45 | Jump Game II | C++ | Hard |
55 | Jump Game | C++ | Medium |
122 | Best Time to Buy and Sell Stock II | C++ | Medium |
134 | Gas Station | C++ | Medium |
316 | Remove Duplicate Letters | C++ | Hard |
376 | Wiggle Subsequence | C++ | Medium |
392 | Is Subsequence | C++ | Medium |
402 | Remove K Digits | C++ | Medium |
406 | Queue Reconstruction by Height | C++ | Medium |
452 | Minimum Number of Arrows to Burst Balloons | C++ | Medium |
455 | Assign Cookies | C++ | Easy |
###Sort
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
57 | Insert Interval | C++ | Hard |
75 | Sort Colors | C++ | Medium |
147 | Insertion Sort List | C++ | Medium |
148 | Sort List | C++ | Medium |
164 | Maximum Gap | C++ | Hard |
179 | Largest Number | C++ | Medium |
242 | Valid Anagram | C++ | Easy |
252 | Meeting Rooms | C++ | Easy |
274 | H-Index | C++ | Medium |
280 | Wiggle Sort | C++ | Medium |
349 | Intersection of Two Arrays | C++ | Easy |
350 | Intersection of Two Arrays II | C++ | Easy |
###Bit Manipulation
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
78 | Subsets | C++ | Medium |
136 | Single Number | C++ | Easy |
137 | Single Number | C++ | Medium |
169 | Majority Element | C++ | Easy |
187 | Repeated DNA Sequences | C++ | Medium |
190 | Reverse Bits | C++ | Easy |
191 | Number of 1 Bits | C++ | Easy |
201 | Bitwise AND of Numbers Range | C++ | Medium |
231 | Power of Two | C++ | Easy |
260 | Single Number III | C++ | Medium |
268 | Missing Number | C++ | Medium |
318 | Maximum Product of Word Lengths | C++ | Medium |
338 | Counting Bits | C++ | Medium |
342 | Power of Four | C++ | Easy |
371 | Sum of Two Integers | C++ | Easy |
389 | Find the Difference | C++ | Easy |
393 | UTF-8 Validation | C++ | Medium |
397 | Integer Replacement | C++ | Medium |
401 | Binary Watch | C++ | Easy |
405 | Convert a Number to Hexadecimal | C++ | Easy |
461 | Hamming Distance | C++ | Easy |
476 | Number Complement | C++ | Easy |
477 | Total Hamming Distance | C++ | Medium |
###Tree
(Notes: "♥" means you need to buy a book from Leetcode)
###Depth-first Search
(Notes: "♥" means you need to buy a book from Leetcode)
###Breadth-first Search
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
101 | Symmetric Tree | C++ | Easy |
102 | Binary Tree Level Order Traversal | C++ | Easy |
103 | Binary Tree Zigzag Level Order Traversal | C++ | Medium |
107 | Binary Tree Level Order Traversal II | C++ | Easy |
111 | Minimum Depth of Binary Tree | C++ | Easy |
127 | Word Ladder | C++ | Medium |
130 | Surrounded Regions | C++ | Medium |
133 | Clone Graph | C++ | Medium |
199 | Binary Tree Right Side View | C++ | Medium |
200 | Number of Islands | C++ | Medium |
207 | Course Schedule | C++ | Medium |
210 | Course Schedule II | C++ | Medium |
261 | Graph Valid Tree | C++ | Medium |
279 | Perfect Squares | C++ | Medium |
286 | Walls and Gates | C++ | Medium |
301 | Remove Invalid Parentheses | C++ | Hard |
323 | Number of Connected Components in an Undirected Graph | C++ | Medium |
513 | Find Bottom Left Tree Value | C++ | Medium |
515 | Find Largest Value in Each Tree Row | C++ | Medium |
530 | Minimum Absolute Difference in BST | C++ | Easy |
###Union Find
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
128 | Longest Consecutive Sequence | C++ | Hard |
130 | Surrounded Regions | C++ | Medium |
200 | Number of Islands | C++ | Medium |
261 | Graph Valid Tree | C++ | Medium |
305 | Number of Islands II | C++ | Hard |
323 | Number of Connected Components in an Undirected Graph | C++ | Medium |
###Gragh
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
133 | Clone Graph | C++ | Medium |
207 | Course Schedule | C++ | Medium |
210 | Course Schedule II | C++ | Medium |
261 | Graph Valid Tree | C++ | Medium |
323 | Number of Connected Components in an Undirected Graph | C++ | Medium |
###Design
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
146 | LRU Cache | C++ | Hard |
155 | Min Stack | C++ | Easy |
173 | Binary Search Tree Iterator | C++ | Medium |
208 | Implement Trie (Prefix Tree) | C++ | Medium |
221 | Maximal Square | C++ | Medium |
225 | Implement Stack using Queues | C++ | Easy |
232 | Implement Queue using Stacks | C++ | Easy |
244 | Shortest Word Distance II | C++ | Medium |
251 | Flatten 2D Vector | C++ | Medium |
284 | Peeking Iterator | C++ | Medium |
297 | Serialize and Deserialize Binary Tree | C++ | Hard |
341 | Flatten Nested List Iterator | C++ | Medium |
346 | Moving Average from Data Stream | C++ | Easy |
348 | Design Tic-Tac-Toe | C++ | Medium |
359 | Logger Rate Limiter | C++ | Easy |
362 | Design Hit Counter | C++ | Medium |
380 | Insert Delete GetRandom O(1) | C++ | Medium |
381 | Insert Delete GetRandom O(1) - Duplicates allowed | C++ | Hard |
###Topological Sort
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
207 | Course Schedule | C++ | Medium |
210 | Course Schedule II | C++ | Medium |
329 | Longest Increasing Path in a Matrix | C++ | Hard |
###Trie
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
208 | Implement Trie (Prefix Tree) | C++ | Medium |
211 | Add and Search Word - Data structure design | C++ | Medium |
221 | Maximal Square | C++ | Medium |
336 | Palindrome Pairs | C++ | Hard |
472 | Concatenated Words | C++ | Hard |
###Binary Indexed Tree
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
218 | The Skyline Problem | C++ | Hard |
307 | Range Sum Query - Mutable | C++ | Medium |
###Segment Tree
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
218 | The Skyline Problem | C++ | Hard |
307 | Range Sum Query - Mutable | C++ | Medium |
###Binary Search Tree
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|
###Recursion
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
247 | Strobogrammatic Number II | C++ | Medium |
###Brainteaser
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
292 | Nim Game | C++ | Easy |
319 | Bulb Switcher | C++ | Medium |
###Memoization
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
329 | Longest Increasing Path in a Matrix | C++ | Hard |
###Queue
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
346 | Moving Average from Data Stream | C++ | Easy |
###Reservoir Sampling
(Notes: "♥" means you need to buy a book from Leetcode)
# | Title | Solution | Difficulty |
---|---|---|---|
382 | Linked List Random Node | C++ | Medium |
398 | Random Pick Index | C++ | Medium |