The number of leetcode questions is increasing every week.
I will constantly seek and summarize better solutions to the problem and keep updating.
- Array
- Bit Binary Search Manipulation
- String
- Linked List
- Stack
- Queue
- Heap
- Tree
- Hash Table
- Math
- Two Pointers
- Sort
- Recursion
- Binary Search
- Binary Search Tree
- Breadth-First Search
- Depth-First Search
- Backtracking
- Dynamic Programming
- Greedy
- Graph
- Geometry
- Simulation
- Design
- Divide and Conquer
# | Title | Solution | Time | Space | Difficulty |
---|---|---|---|---|---|
239 | Sliding Window Maximum | Python | O(n) | O(1) | Hard |
281 | Zigzag Iterator | Python | Medium | ||
346 | Moving Average from Data Stream | Python | Easy | ||
862 | Shortest Subarray with Sum at Least K | Python | Hard |
# | Title | Solution | Time | Space | Difficulty |
---|---|---|---|---|---|
264 | Ugly Number II | Python | Medium | ||
295 | Find Median from Data Stream | Python | Hard | ||
313 | Super Ugly Number | Python | Medium | ||
358 | Rearrange String k Distance Apart | Python | Hard | ||
373 | Find K Pairs with Smallest Sums | Python | Medium | ||
378 | Kth Smallest Element in a Sorted Matrix | Python | Medium | ||
407 | Trapping Rain Water II | Python | Hard | ||
632 | Smallest Range | Python | Hard | ||
846 | Hand of Straights | Python | Medium | ||
855 | Exam Room | Python | Medium | ||
857 | Minimum Cost to Hire K Workers | Python | Hard | ||
871 | Minimum Number of Refueling Stops | Python | Hard |
# | Title | Solution | Time | Space | Difficulty |
---|---|---|---|---|---|
056 | Merge Intervals | Python | O(n) | O(1) | Medium |
057 | Insert Interval | Python | Hard | ||
075 | Sort Colors | Python | O(n) | O(1) | Medium |
088 | Merge Sorted Array | Python | O(n) | O(1) | Easy |
147 | Insertion Sort List | Python | Medium | ||
148 | Sort List | Python | Medium | ||
164 | Maximum Gap | Python | Hard | ||
179 | Largest Number | Python | O(nlogn) | O(1) | Medium |
218 | The Skyline Problem | Python | Hard | ||
242 | Valid Anagram | Python | O(n) | O(1) | Easy |
252 | Meeting Rooms | Python | Easy | ||
253 | Meeting Rooms II | Python | Medium | ||
274 | H-Index | Python | Medium | ||
280 | Wiggle Sort | Python | Medium | ||
324 | Wiggle Sort II | Python | Medium | ||
347 | Top K Frequent Elements | Python | Medium | ||
406 | Queue Reconstruction by Height | Python | Medium | ||
451 | Sort Characters By Frequency | Python | O(nlogn) | 1 | Medium |
692 | Top K Frequent Words | Python | Medium |
# | Title | Solution | Time | Space | Difficulty |
---|---|---|---|---|---|
220 | Contains Duplicate III | Python | O(1) | Medium | |
230 | Kth Smallest Element in a BST | Python | O(logn) | O(n) | Medium |
235 | Lowest Common Ancestor of a Binary Search Tree | Python | O(n) | O(1) | Easy |
270 | Closest Binary Search Tree Value | Python | Easy | ||
285 | Inorder Successor in BST | Python | Medium | ||
352 | Data Stream as Disjoint Intervals | Python | Hard | ||
449 | Serialize and Deserialize BST | Python | Medium | ||
450 | Delete Node in a BST | Python | Medium | ||
530 | Minimum Absolute Difference in BST | Python | Easy | ||
776 | Split BST | Python | Medium | ||
783 | Minimum Distance Between BST Nodes | Python | Easy |
# | Title | Solution | Time | Space | Difficulty |
---|---|---|---|---|---|
765 | Couples Holding Hands | Python | Hard |
# | Title | Solution | Time | Space | Difficulty |
---|---|---|---|---|---|
587 | Erect the Fence | Python | Hard |
# | Title | Solution | Time | Space | Difficulty |
---|---|---|---|---|---|
874 | Walking Robot Simulation | Python | Easy |
# | Title | Solution | Time | Space | Difficulty |
---|---|---|---|---|---|
169 | Majority Element | Python | O(1) | Easy |
# | Title | Solution | Difficulty |
---|---|---|---|
175 | Combine Two Tables | MySQL | Easy |
176 | Second Highest Salary | MySQL | Easy |
177 | Nth Highest Salary | MySQL | Medium |
178 | Rank Scores | MySQL | Medium |
180 | Consecutive Numbers | MySQL | Medium |
181 | Employees Earning More Than Their Managers | MySQL | Easy |
182 | Duplicate Emails | MySQL | Easy |
183 | Customers Who Never Order | MySQL | Easy |
184 | Department Highest Salary | MySQL | Medium |
185 | Department Top Three Salaries | MySQL | Hard |
196 | Delete Duplicate Emails | MySQL | Easy |
197 | Rising Temperature | MySQL | Easy |
262 | Trips and Users | MySQL | Hard |
595 | Big Countries | MySQL | Easy |
620 | Not Boring Movies | MySQL | Easy |
627 | Swap Salary | MySQL | Easy |
# | Title | Solution | Difficulty |
---|---|---|---|
192 | Word Frequency | Shell | Medium |
193 | Valid Phone Numbers | Shell | Easy |
194 | Transpose File | Shell | Medium |
195 | Tenth Line | Shell | Easy |