Skip to content

Latest commit

 

History

History
239 lines (173 loc) · 14.8 KB

leetcode.md

File metadata and controls

239 lines (173 loc) · 14.8 KB

leetcode log

2018-10-12

title time solution
64. Minimum Path Sum 73
62. Unique Paths 86.69 O(n)_space_discuess
73. Set Matrix Zeroes 84 ms solution

2018-10-14

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

2018-10-15

title time solution
78. Subsets 56ms bit,

2018-10-16

title time solution
784. Letter Case Permutation 88ms/32% optmize!

2018-10-17

title time solution
90. Subsets II 60ms see duplicate elements as the elements repeat n times
90. Subsets II 64ms dfs

2018-10-19

title time solution
46.Permutations 68ms/86% self, the dp-like solutuon is intresting
60.Permutation Sequence 52ms

2018-10-28

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

2018-11-07

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

2018-11-19

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

2018-11-20

title time solution
34.largest-rectangle-in-histogram 64ms/73.87% video

2018-11-21

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

2018-11-23

title time solution
120. Triangle 56ms
53. Maximum Subarray 56ms

2018-11-24

| 152. Maximum Product Subarray | 56ms |

2018-11-26

title time solution
167. two-sum-ii-input-array-is-sorted 56ms need more solutions

2018-11-30/2018-12-02

title time solution
189. rotate-array 64ms cyclic_replace interesting
209.minimum-size-subarray-sum 56 n

2018-12-02

title time solution
209.minimum-size-subarray-sum 60ms nlogn
216. Combination Sum III 56/45.63 need optmize

2018-12-09

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

2018-12-14

title time solution
229. Majority Element II 60ms so bad

2018-12-15

title time solution
283. Move Zeroes 64ms

2018-12-16

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

2018-12-20

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

2018-12-21

title time solution
88. Merge Sorted Array 52 self reverse traversal
268. Missing Number 60 need more solutions

2019-01-04

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%

2019-06-06

title time memory solution
47. Permutations II 95.32% 96.01%
238. Product of Array Except Self 97% 96%

2019-06-09

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

2019-06-10

title time memory solution
448. Find All Numbers Disappeared in an Array 96.62% 82.17% dis

2019-06-11

title time memory solution
442. Find All Duplicates in an Array 92.77% 70.87%
457. Circular Array Loop 58% 50% too slow

2019-06-12

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%

2019-06-14

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%

2019-06-16

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

2019-06-17

title time memory solution
643. Maximum Average Subarray I 90%/84ms 73%

2019-06-28

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

2019-06-30

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%