用Yu Zhou大神的这份Q&A作为刷题参考,同时记录自己完成/参考的情况和时间线
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
624 | Maximum Distance in Arrays | Python | O(n) | O(1) | ✅ |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
3 | Longest Substring Without Repeating Characters | Python | O(n) | O(n) | ✅ |
463 | Island Perimeter | Python | O(n^2) | O(1) | ✅ |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
1 | Two Sum | Python | O(n) | O(n) | ✅📺 |
242 | Valid Anagram | Python | O(n) | O(n) | ✅ |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
21 | Merge Two Sorted Lists | Python | O(n) | O(n) | ✅ |
206 | Reverse Linked List | Python | O(n) | O(1) | ✅ |
234 | Palindrome Linked List | Python | O(n) | O(1) | ✅ |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
19 | Remove Nth Node From End of List | Python | O(n) | O(1) | ✅ |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
155 | Min Stack | Python | O(1) | O(n) | ✅ |
225 | Implement Stack using Queues | Python | push/pop: O(1) top:O(n) | O(n) | ✅ |
20 | Valid Parentheses | Python | O(n) | O(n) | ✅ |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
232 | Implement Queues using Stack | ✅ | |||
406 | Queue Reconstruction by Height | ✅ | |||
204 | Count Primes | ✅ |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
112 | Path Sum | Python | O(N) | O(h) | 📺✅ |
101 | Symmetric Tree | Python | O(N) | O(1) | 📺✅ |
104 | Maximum Depth of Binary Tree | Python | O(N) | O(1) | ✅ |
108 | Convert Sorted Array to Binary Search Tree | Python | O(N) | O(N) | 📺✅ |
109 | Convert Sorted List to Binary Search Tree | O(Nlog(N)) | ✅ | ||
538 | Convert BST to Greater Tree | Python | O(N) | O(1) | ✅ |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
102 | Binary Tree Level Order Traversal | Python | O(N) | O(N) | ✅📺 |
114 | Flatten Binary Tree to Linked List | Python | O(N) | O(1) | ✅📺 |
230 | Kth Smallest Element in a BST | Python | O(N) | O(1) | ✅📺 |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
78 | Subsets | Python | O(N*(2^N)) | O(2^N) | ✅📺 |
46 | Permutations | Python | O(N*(N!)) | O(N!) | ✅📺 |
39 | Combination Sum | Python | O(K * (2^N) | O(N) | ✅ |
17 | Letter Combinations of a Phone Number | Python | O(N*(4^N)) | O(N) | ✅📺 |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
70 | Climbing Stairs | Python | O(N) | O(1) | ✅ |
53 | Maximum Subarray | Python | O(N) | O(N) | 📺 ✅ |
198 | House Robber | Python | O(N) | O(N) | 📺✅ |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
62 | Unique Paths | Python | O(N^2) | O(M*N) | ✅ |
55 | Jump Game | Python | O(N^2) | O(1) | ✅ |
# | Title | Solution | Time | Space | State |
---|---|---|---|---|---|
136 | Single Number | Python | O(N) | O(1) | 📺✅ |
🌱 MIT @ Yu Zhou 🌱