# | Problems | Difficulty | Solutions | Key Points |
---|---|---|---|---|
1 | Two Sum | Easy | 📝 | Hash |
2 | Add Two Numbers | Medium | 📝 | Linked List |
3 | Longest Substring Without Repeating Characters | Medium | 📝 | ASCII Array | Hash | Sliding Window |
4 | Median of Two Sorted Arrays | Hard | 📝 | Binary Search |
11 | Container With Most Water | Medium | 📝 | Two Pointers |
15 | 3Sum | Medium | 📝 | Hash | Sort | Two Pointers |
19 | Remove Nth Node From End of List | Medium | 📝 | Two Pointers |
20 | Valid Parentheses | Easy | 📝 | Stack |
21 | Merge Two Sorted Lists | Easy | 📝 | Just Merge |
22 | Generate Parentheses | Medium | 📝 | Backtracking |
23 | Merge k Sorted Lists | Hard | 📝 | Min-heap | Merge Sort |
25 | Reverse Nodes in k-Group | Hard | 📝 | Reverse Every Group And Reconnect | Head Insertion to Reverse List | Dummy Node |
28 | Find the Index of the First Occurrence in a String | Medium | 📝 | KMP |
33 | Search in Rotated Sorted Array | Medium | 📝 | Binary Search |
36 | Valid Sudoku | Medium | 📝 | Hash | Boolean Array |
42 | Trapping Rain Water | Hard | 📝 | DP - Pre-compute Left Max and Right Max | Two Pointers |
49 | Group Anagrams | Medium | 📝 | Hash | Letter Count Char Array |
74 | Search a 2D Matrix | Medium | 📝 | Binary Search As 1D |
76 | Minimum Window Substring | Hard | 📝 | Sliding Window | Letter Count Array |
84 | Largest Rectangle in Histogram | Hard | 📝 | Monotonic Stack | DP |
98 | Validate Binary Search Tree | Medium | 📝 | DFS + from bottom to top + left max + right min | DFS + from top to bottom + interval |
100 | Same Tree | Easy | 📝 | Recursion | DFS | BFS |
102 | Binary Tree Level Order Traversal | Medium | 📝 | BFS |
104 | Invert Binary Tree | Easy | 📝 | Recursion | Breadth First Search With Queue |
105 | Construct Binary Tree from Preorder and Inorder Traversal | Medium | 📝 | Recursion + hashmap |
110 | Balanced Binary Tree | Easy | 📝 | Recursion + class variable + height of every node | Recursion + pruning + height of partial node |
121 | Best Time to Buy and Sell Stock | Easy | 📝 | Sliding Window | Iteration | DP |
125 | Valid Palindrome | Easy | 📝 | Two Pointers |
126 | Binary Tree Maximum Path Sum | Hard | 📝 | DFS + maximum contribution of subtree |
128 | Longest Consecutive Sequence | Medium | 📝 | Hash | Consecutive Number |
138 | Copy List with Random Pointer | Medium | 📝 | Hash Map | Next Pointer Points to The New Node |
141 | Linked List Cycle | Easy | 📝 | Slow And Fast Pointer |
146 | LRU cache | Medium | 📝 | HashMap - Double Linked List |
143 | Reorder List | Medium | 📝 | Slow And Fast Pointer - Reverse List |
150 | Evaluate Reverse Polish Notation | Medium | 📝 | Stack |
153 | Find Minimum in Rotated Sorted Array | Medium | 📝 | Binary Search |
155 | Min Stack | Easy | 📝 | Two Stack - Min Value Stack | One Stack - 2x-min(old)<min(new) |
167 | Two Sum II - Input Array Is Sorted | Medium | 📝 | Two Pointers |
199 | Binary Tree Right Side View | Medium | 📝 | BFS |
206 | Reverse Linked List | Easy | 📝 | Pointers |
208 | Implement Trie (Prefix Tree) | Medium | 📝 | children[26] + is leaf + dummy root node |
211 | Design Add and Search Words Data Structure | Medium | 📝 | Trie (Prefix Tree) + DFS for '.' |
212 | Word Search II | Hard | 📝 | Trie (prefix tree) + DFS + backtracking + node keep the word |
215 | Kth Largest Element in an Array | Medium | 📝 | Randomized Quick Select + partition |
217 | Contains Duplicate | Easy | 📝 | Hash |
226 | Invert Binary Tree | Easy | 📝 | Recursion | Breadth First Search With Queue |
230 | Kth Smallest Element in a BST | Medium | 📝 | InOrder by recursion + List | InOrder by iteration + Stack |
235 | Lowest Common Ancestor of a Binary Search Tree | Medium | 📝 | BST |
238 | Product of Array Except Self | Medium | 📝 | Arrays |
239 | Sliding Window Maximum | Hard | 📝 | Sliding Window | Max-heap | Monotonic Queue |
242 | Valid Anagram | Easy | 📝 | Hash | Letter Count Array |
271 | Encode and Decode Strings 🔒 | Medium | 📝 | Length of String |
287 | Find the Duplicate Number | Medium | 📝 | Binary Search | Linked List With Cycle - Floyd‘s Algorithm |
297 | Serialize and Deserialize Binary Tree | Hard | 📝 | DFS + preorder + null node |
347 | Top K Frequent Elements | Medium | 📝 | Min-heap |
424 | Longest Repeating Character Replacement | Medium | 📝 | Sliding Window | Hash | Letter Count Array | History Max Character Count |
543 | Diameter of Binary Tree | Easy | 📝 | Recursion + diameter and height of every node | Recursion + class variable keeping the diameter + height of every node |
567 | Permutation in String | Medium | 📝 | Sliding Window | Letter Count Array |
572 | Subtree of Another Tree | Easy | 📝 | Recursion + same tree | Preorder + serialize + KMP | Hash + Spurious Hits |
621 | Task Scheduler | Meidum | 📝 | Max-heap | max count of tasks + formula |
703 | Last Stone Weight | Easy | 📝 | Min-heap |
704 | Binary Search | Easy | 📝 | Binary Search |
739 | Daily Temperatures | Medium | 📝 | Stack |
853 | Car Fleet | Medium | 📝 | Stack | Sort |
875 | Koko Eating Bananas | Medium | 📝 | Binary Search Eating Speed |
973 | K Closest Points to Origin | Medium | 📝 | Max-heap |
981 | Time Based Key-Value Store | Medium | 📝 | Binary Search |
1046 | Last Stone Weight | Easy | 📝 | Max-heap |
1448 | Count Good Nodes in Binary Tree | Medium | 📝 | DFS + max value |
-
Notifications
You must be signed in to change notification settings - Fork 0
chenx2code/leetcode
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Solutions to leetcode problems.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published