记录LeetCode刷题记录,参考halfrost大佬的解题思路,记录C++/Python解法
| No. | Title | Solution | difficulty | TimeComplexity | SpaceComplexity |
|---|---|---|---|---|---|
| 0001 | Two Sum | Solution | easy | O(n) | O(n) |
| 0026 | Remove Duplicates from Sorted Array | Solution | easy | O(n) | O(1) |
| 0027 | Remove Element | Solution | easy | O(n) | O(1) |
| 0033 | Search in Rotated Sorted Array | Solution | Mideum | O(logn) | O(1) |
| 0034 | Find First and Last Position of Element in Sorted Array | Solution | Mideum | O(logn) | O(1) |
| 0035 | Search Insert Position | Solution | easy | O(logn) | O(1) |
| 0053 | Maximum Subarray | Solution | easy | O(n) | O(1) |
| 0167 | Two Sum II - Input array is sorted | Solution | easy | O(n) | O(1) |
| 0048 | Rotate Image | Solution | Medium | O(n^2) | O(1) |
| No. | Title | Solution | difficulty | TimeComplexity | SpaceComplexity |
|---|---|---|---|---|---|
| 0206 | Reverse Linked List | Solution | easy | O(n) | O(1) |
| No. | Title | Solution | difficulty | TimeComplexity | SpaceComplexity |
|---|---|---|---|---|---|
| 0236 | Lowest Common Ancestor of a Binary Tree | Solution | Mideum | O(n) | O(n) |
| No. | Title | Solution | difficulty | TimeComplexity | SpaceComplexity |
|---|---|---|---|---|---|
| 0033 | Search in Rotated Sorted Array | Solution | Mideum | O(logn) | O(1) |
| 0034 | Find First and Last Position of Element in Sorted Array | Solution | Mideum | O(logn) | O(1) |
| 0035 | Search Insert Position | Solution | easy | O(logn) | O(1) |
| 0069 | Sqrt(x) | Solution | easy | O(logn) | O(1) |
| 0167 | Two Sum II - Input array is sorted | Solution | easy | O(n) | O(1) |
| No. | Title | Solution | difficulty | TimeComplexity | SpaceComplexity |
|---|---|---|---|---|---|
| 0029 | Divide Two Integers | Solution | Mideum |