A record repository of leetcode exercise. Solution for LeetCode problems, for remember me not to relax in coding.
# | Title | Solution | Difficulty | Tag |
---|---|---|---|---|
263 | Ugly Number | C++ | Easy | Math |
268 | Missing Number | C++ | Medium | Array, Math, Bit Manipulation |
# | Title | Solution | Difficulty | Tag |
---|---|---|---|---|
344 | Reverse String | C++ | Easy | String, Two Pointers |
345 | Reverse Vowels of a String | C++ | Easy | String, Two Pointers |
67 | Add Binary | C++ | Easy | String, Math |
78 | Subsets | C++ | Medium | Array, Backtracking, Bit Manipulation |
86 | Partition List | C++ | Medium | Linked List, Two Pointers |
173 | Binary Search Tree Iterator | C++ | Medium | Tree, Stack, Design |
332 | Reconstruct Itinerary | C++ | Medium | DFS, Graph |
235 | Lowest Common Ancestor of a Binary Search Tree | C++ | Easy | Tree |
118 | Pascal's Triangle | C++ | Easy | Array |
20 | Valid Parentheses | C++ | Easy | Stack, String |
100 | Same Tree | C++ | Easy | Tree, DFS |
104 | Maximum Depth of Binary Tree | C++ | Easy | Tree, DFS |
121 | Best Time to Buy and Sell Stock | C++ | Easy | Array, Dynamic Programming |
264 | Ugly Number II | C++ | Medium | Dynamic Programming, Heap, Math |
55 | Jump Game | C++ | Medium | Array, Greedy |
217 | Contains Duplicate | C++ | Easy | Array, Hash Table |
219 | Contains Duplicate II | C++ | Easy | Array, Hash Table |
220 | Contains Duplicate III | C++ | Medium | Binary Search Tree |
133 | Clone Graph | C++ | Medium | DFS, BFS, Graph |
231 | Power of Two | C++ | Easy | Math, Bit Manipulation |
49 | Group Anagrams | C++ | Medium | Hash Table, String |
# | Title | Solution | Difficulty | Tag |
---|---|---|---|---|
135 | Candy | C++ | Hard | Greedy |
51 | N-Queens | C++ | Hard | Backtracking |
119 | Pascal's Triangle II | C++ | Easy | Array |
102 | Binary Tree Level Order Traversal | C++ | Easy | Tree, BFS |
128 | Longest Consecutive Sequence | C++ | Hard | Array, Union Find |
71 | Simplify Path | C++ | Medium | Stack, String |
205 | Isomorphic Strings | C++ | Easy | Hash Table |
150 | Evaluate Reverse Polish Notation | C++ | Medium | Stack |
242 | Valid Anagram | C++ | Easy | Hash Table, Sort |
109 | Convert Sorted List to Binary Search Tree | C++ | Medium | DFS, Linked List |
108 | Convert Sorted Array to Binary Search Tree | C++ | Medium | Tree, DFS |
21 | Merge Two Sorted Lists | C++ | Easy | Linked List |
349 | Intersection of Two Arrays | C++ | Easy | Binary Search, Hash Table, Two Pointers, Sort |
143 | Reorder List | C++ | Medium | Linked List |
52 | N-Queens II | C++ | Hard | Backtracking |
83 | Remove Duplicates from Sorted List | C++ | Easy | Linked List |
122 | Best Time to Buy and Sell Stock II | C++ | Medium | Array, Greedy |
144 | Binary Tree Preorder Traversal | C++ | Medium | Tree, Stack |
237 | Delete Node in a Linked List | C++ | Easy | Linked List |
350 | Intersection of Two Arrays II | C++ | Easy | Binary Search, Hash Table, Two Pointers, Sort |
226 | Invert Binary Tree | C++ | Easy | Tree |
195 | Tenth Line | Shell | Easy | Bash |
215 | Kth Largest Elements in an Array | C++ | Medium | Heap, Divide and Conquer |
111 | Minimum Depth of Binary Tree | C++ | Easy | Tree, DFS, BFS |
110 | Balanced Binary Tree | C++ | Easy | Tree, DFS |
257 | Binary Tree Paths | C++ | Easy | Tree, DFS |
222 | Count Complete Tree Nodes | C++ | Medium | Tree, Binary Search |
241 | Different Ways to Add Parentheses | C++ | Medium | Divide and Conquer |
# | Title | Solution | Difficulty | Tag |
---|---|---|---|---|
287 | Find the Duplicate Number | C++ | Hard | Binary Search, Array, Two Pointers |
342 | Power of Four | C++ | Easy | Bit Manipulation |
136 | Single Number | C++ | Medium | Hash Table, Bit Manipulation |
137 | Single Number II | C++ | Medium | Bit Manipulation |
260 | Single Number III | C++ | Medium | Bit Manipulation |
45 | Jump Game II | C++ | Hard | Greedy, Array |
134 | Gas Station | C++ | Medium | Greedy |
328 | Odd Even Linked List | C++ | Medium | Linked List |
112 | Path Sum | C++ | Easy | Tree, DFS |
113 | Path Sum II | C++ | Medium | Tree, DFS |
303 | Range Sum Query - Immutable | C++ | Easy | Dynamic Programming |
141 | Linked List Cycle | C++ | Easy | Linked List, Two Pointers |
279 | Perfect Squares | C++ | Medium | Dynamic Programming, BFS, Math |
# | Title | Solution | Difficulty | Tag |
---|---|---|---|---|
75 | Sort Colors | C++ | Medium | Array, Two Pointers, Sort |
25 | Reverse Nodes in k-Group | C++ | Hard | Linked List |
198 | House Robber | C++ | Easy | Dynamic Programming |
213 | House Robber II | C++ | Medium | Dynamic Programming |
337 | House Robber III | C++ | Medium | Tree, DFS |
62 | Unique Paths | C++ | Medium | Array, Dynamic Programming |
63 | Unique Paths II | C++ | Medium | Array, Dynamic Programming |
10 | Regular Expression Matching | C++ | Hard | Dynamic Programming, |
146 | LRU Cache | C++ | Hard | Design |
105 | Construct Binary Tree from Preorder and Inorder Traversal | C++ | Medium | Tree, Array, DFS |
# | Title | Solution | Difficulty | Tag |
---|---|---|---|---|
73 | Set Matrix Zero | C++ | Medium | Array |
61 | Rotate List | C++ | Medium | Linked List, Two Pointers |
53 | Maximum Subarray | C++ | Medium | Array, Dynamic Programming, Divide and Conquer |
69 | Sqrt(x) | C++ | Medium | Binary Search, Math |
# | Title | Solution | Difficulty | Tag |
---|---|---|---|---|
367 | Valid Perfect Square | C++ | Medium | Binary Search, Math |
194 | Max Points on a Line | C++ | Hard | Hash Table, Math |
199 | Binary Tree Right Side View | C++ | Medium | Tree, DFS, BFS |
203 | Remove Linked List Elements | C++ | Easy | Linked List |
338 | Counting Bits | C++ | Medium | Dynamic Progamming, Bit Manipulation |
191 | Number of 1 Bits | C++ | Easy | Bit Manipulation |
224 | Basic Calculator | C++ | Hard | Stack, Math |
# | Title | Solution | Difficulty | Tag |
---|---|---|---|---|
190 | Reverse Bits | C++ | Easy | Bit Manipulation |
# | Title | Solution | Difficulty | Tag |
---|---|---|---|---|
440 | K-th Smallest in Lexicographical Order | Python | Hard | Tree |
485 | Max Consecutive Ones | Python | Easy | Array |
455 | Assign Cookies | Python, C++ | Easy | Greedy |
412 | Fizz Buzz | Python | Easy | Math |
372 | Super Pow | C++ | Medium | Math |
473 | Matchsticks to Square | C++ | Medium | DFS |
160 | Intersection of Two Linked Lists | C++ | Easy | Linked List |
258 | Add Digits | C++ | Easy | Math |
68 | Text Justification | Python | Hard | String |
# | Title | Solution | Difficulty | Tag |
---|---|---|---|---|
2 | Add Two Numbers | C++ | Medium | Linked List, Mat |
543 | Diameter of Binary Tree | C++ | Easy | Tree |