title | time | solution |
---|---|---|
64. Minimum Path Sum | 73 | |
62. Unique Paths | 86.69 | O(n)_space_discuess |
73. Set Matrix Zeroes | 84 ms | solution |
title | time | solution |
---|---|---|
73. Set Matrix Zeroes | 84 ms | solution |
289. Game of Life | 100% | self, but solution bit operate is more beautiful |
74. Search a 2D Matrix | 100% 52ms | self, treat as Binary search |
title | time | solution |
---|---|---|
78. Subsets | 56ms | bit, |
title | time | solution |
---|---|---|
784. Letter Case Permutation | 88ms/32% | optmize! |
title | time | solution |
---|---|---|
90. Subsets II | 60ms | see duplicate elements as the elements repeat n times |
90. Subsets II | 64ms | dfs |
title | time | solution |
---|---|---|
46.Permutations | 68ms/86% | self, the dp-like solutuon is intresting |
60.Permutation Sequence | 52ms |
title | time | solution |
---|---|---|
79.Word Search | 72ms/100% | dfs |
80.Remove Duplicates from Sorted Array II | 68ms/80% | self, n>nums[n-2] is awesome |
title | time | solution |
---|---|---|
33.Search in Rotated Sorted Array | 56ms/64% | 52ms max |
153.find-minimum-in-rotated-sorted-array | 52 | |
154.find-minimum-in-rotated-sorted-array-ii | 52ms |
title | time | solution |
---|---|---|
81.search-in-rotated-sorted-array-ii | 56ms | [trick](nums[start] == nums[middle] && nums[middle] == nums[end]) |
34.find-first-and-last-position-of-element-in-sorted-array | 56ms | a little complex |
title | time | solution |
---|---|---|
34.largest-rectangle-in-histogram | 64ms/73.87% | video |
title | time | solution |
---|---|---|
105. Construct Binary Tree from Preorder and Inorder Traversal | 72ms | |
106. Construct Binary Tree from Inorder and Postorder Traversal | 72ms | |
118. Pascal's Triangle | 48 | |
119. Pascal's Triangle II | 52 |
title | time | solution |
---|---|---|
120. Triangle | 56ms | |
53. Maximum Subarray | 56ms |
| 152. Maximum Product Subarray | 56ms |
title | time | solution |
---|---|---|
167. two-sum-ii-input-array-is-sorted | 56ms | need more solutions |
title | time | solution |
---|---|---|
189. rotate-array | 64ms | cyclic_replace interesting |
209.minimum-size-subarray-sum | 56 | n |
title | time | solution |
---|---|---|
209.minimum-size-subarray-sum | 60ms | nlogn |
216. Combination Sum III | 56/45.63 | need optmize |
title | time | solution |
---|---|---|
39. Combination Sum | 68ms | |
77. Combinations | 108ms/100ms | self/trick |
40. Combination Sum II | 104ms/68ms | self/solution, don't know why this solution is so much faster. |
228. Summary Ranges | 48 | self |
title | time | solution |
---|---|---|
229. Majority Element II | 60ms | so bad |
title | time | solution |
---|---|---|
283. Move Zeroes | 64ms |
title | time | solution |
---|---|---|
57. Insert Interval | 64-92 | Can be more elegant |
128. Longest Consecutive Sequence | 60 - 96 | I think the time complexity is the lowest, but why the running time is very unstable |
title | time | solution |
---|---|---|
48. Rotate Image | 52 | |
121. Best Time to Buy and Sell Stock | 56 | |
122. Best Time to Buy and Sell Stock II | 60 |
title | time | solution |
---|---|---|
88. Merge Sorted Array | 52 | self reverse traversal |
268. Missing Number | 60 | need more solutions |
title | time | solution |
---|---|---|
56. Merge Intervals | 76/84% | insert(72ms) can be more efficient, use hashmap instead of sorting(64) is awesome |
217. Contains Duplicate | 72 | |
219. Contains Duplicate II | 68/94% |
title | time | memory | solution |
---|---|---|---|
47. Permutations II | 95.32% | 96.01% | |
238. Product of Array Except Self | 97% | 96% |
title | time | memory | solution |
---|---|---|---|
287. Find the Duplicate Number | 94% | 73% | binary search/two pointer |
381. Insert Delete GetRandom O(1) - Duplicates allowed | 90% | 5.77% | |
414. Third Maximum Number | 96% | 83% | top k |
title | time | memory | solution |
---|---|---|---|
448. Find All Numbers Disappeared in an Array | 96.62% | 82.17% | dis |
title | time | memory | solution |
---|---|---|---|
442. Find All Duplicates in an Array | 92.77% | 70.87% | |
457. Circular Array Loop | 58% | 50% | too slow |
title | time | memory | solution |
---|---|---|---|
1004. Max Consecutive Ones III | 98.54% | 85.23% | |
485. Max Consecutive Ones | 97% | 23% | |
532. K-diff Pairs in an Array | 57% | 54% |
title | time | memory | solution |
---|---|---|---|
560. Subarray Sum Equals K | 75% | 29% | hashMap |
561. Array Partition I | 96% | 33% | |
565. Array Nesting | 93% | 95% | |
566. Reshape the Matrix | 84% | 83% |
title | time | memory | solution |
---|---|---|---|
75. Sort Colors | 98% | 79% | Dijkstra |
581. Shortest Unsorted Continuous Subarray | 93% | 75% | one Round |
611. Valid Triangle Number | 86% | 25% | 3sum |
title | time | memory | solution |
---|---|---|---|
643. Maximum Average Subarray I | 90%/84ms | 73% |
title | time | memory | solution |
---|---|---|---|
665. Non-decreasing Array | 78% | 41% | |
670. Maximum Swap | 88.92% | 85.71% | |
674. Longest Continuous Increasing Subsequence | 81.7%/56ms | 30% | |
695. Max Area of Island | 91%/76ms | 96% | mark island to 0 to avoid repeated counting |
697. Degree of an Array | 76ms/60% | 80%+ | this is ok |
title | time | memory | solution |
---|---|---|---|
713. Subarray Product Less Than K | 90%+ | ||
714. Best Time to Buy and Sell Stock with Transaction Fee | dp | ||
717. 1-bit and 2-bit Characters | 94% |