Notebooks of Leetcode Brushers! Code brushed in C++|Java|Python
now!
- 1.two-sum - E: py3, C++, Java
- 31.next-permutation - M: py3
- 33.search-in-rotated-sorted-array - M: py3
- 42.trapping-rain-water - H: py3, C++
- 50.powx-n - M: py3
- 56.merge-intervals - M: py3, C++
- 67.add-binary - E: py3
- 71.simplify-path - M: py3
- 78.subsets - M: py3
- 124.binary-tree-maximum-path-sum - H: py3
- 139.word-break - M: py3
- 140.word-break-ii - H: py3
- 151.reverse-words-in-a-string - M: py3
- 208.implement-trie-prefix-tree - M: py3
- 199.binary-tree-right-side-view - M: py3
- 215.kth-largest-element-in-an-array - M: py3
- 227.basic-calculator-ii - M: py3
- 236.lowest-common-ancestor-of-a-binary-tree - M: py3
- 314.binary-tree-vertical-order-traversal - M: py3
- 347.top-k-frequent-elements - M: py3
- 370.range-addition - M: py3
- Range Caching
- 408.valid-word-abbreviation - E: py3
- 415.add-strings - E: py3
- 426.convert-binary-search-tree-to-sorted-doubly-linked-list - M: py3
- 528.random-pick-with-weight - M: py3
- 543.diameter-of-binary-tree - E: py3
- 560.subarray-sum-equals-k - M: py3
- 680.valid-palindrome-ii - E: py3
- 704.binary-search - E: py3
- 912.sort-an-array - M: py3
- 953.verifying-an-alien-dictionary - E: py3, C++
- 987.vertical-order-traversal-of-a-binary-tree - H: py3
- 1249.minimum-remove-to-make-valid-parentheses - M: py3
- 1662.check-if-two-string-arrays-are-equivalent - E: py3
- Brush the problems of the same kind together.
- Brush different kind of problems every day. One day, one category.
- Brush each problem at least 3 times:
- 1st time: check the answer if no ideas in 5 minutes.
- 2nd time: check the answer if cannot solve independently in 30 minutes.
- 3rd time: try to solve a problem in 15-20 minutes.
- Always and often check great answers from others in the 75-90 percentile run time.
- Lower percentile answers might not be of high quality.
- The most quick answer might contain too much weird tricks that is not universally useful.
- The most important categories are: searching, DP, graph, tree, binary search.
- Practice DP problems as much as you can.
- It is not guaranteed that you can always successfully find a DP formula each time.
- References: