diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..732f944b --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +custom: ["https://paypal.me/foreverbonfy", "https://raw.githubusercontent.com/bonfy/image/master/global/sponsor.jpg"] diff --git a/Pipfile.lock b/Pipfile.lock index 8a0b8cb9..2cf30811 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -92,11 +92,11 @@ }, "requests": { "hashes": [ - "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e", - "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b" + "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", + "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31" ], "index": "pypi", - "version": "==2.21.0" + "version": "==2.22.0" }, "selenium": { "hashes": [ @@ -108,11 +108,11 @@ }, "urllib3": { "hashes": [ - "sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39", - "sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22" + "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", + "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232" ], "index": "pypi", - "version": "==1.24.1" + "version": "==1.25.3" } }, "develop": {} diff --git a/README.md b/README.md index 6a5b3d84..dec58ec4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # :pencil2: Leetcode Solutions with Python,Rust -Update time: 2019-04-08 13:15:22 +Update time: 2019-08-24 06:54:58 Auto created by [leetcode_generate](https://github.com/bonfy/leetcode) -I have solved **100 / 973** problems -while there are **140** problems still locked. +I have solved **113 / 1084** problems +while there are **173** problems still locked. If you want to use this tool please follow this [Usage Guide](https://github.com/bonfy/leetcode/blob/master/README_leetcode_generate.md) @@ -59,7 +59,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |41|[first-missing-positive](https://leetcode.com/problems/first-missing-positive)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0041-first-missing-positive/first-missing-positive.py)|[:memo:](https://leetcode.com/articles/first-missing-positive/)|Hard| |42|[trapping-rain-water](https://leetcode.com/problems/trapping-rain-water)||[:memo:](https://leetcode.com/articles/trapping-rain-water/)|Hard| |43|[multiply-strings](https://leetcode.com/problems/multiply-strings)|||Medium| -|44|[wildcard-matching](https://leetcode.com/problems/wildcard-matching)|||Hard| +|44|[wildcard-matching](https://leetcode.com/problems/wildcard-matching)||[:memo:](https://leetcode.com/articles/wildcard-matching/)|Hard| |45|[jump-game-ii](https://leetcode.com/problems/jump-game-ii)|||Hard| |46|[permutations](https://leetcode.com/problems/permutations)||[:memo:](https://leetcode.com/articles/permutations/)|Medium| |47|[permutations-ii](https://leetcode.com/problems/permutations-ii)|||Medium| @@ -68,11 +68,11 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |50|[powx-n](https://leetcode.com/problems/powx-n)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0050-powx-n/powx-n.py)|[:memo:](https://leetcode.com/articles/powx-n/)|Medium| |51|[n-queens](https://leetcode.com/problems/n-queens)||[:memo:](https://leetcode.com/articles/n-queens/)|Hard| |52|[n-queens-ii](https://leetcode.com/problems/n-queens-ii)||[:memo:](https://leetcode.com/articles/n-queens-ii/)|Hard| -|53|[maximum-subarray](https://leetcode.com/problems/maximum-subarray)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0053-maximum-subarray/maximum-subarray.py)||Easy| +|53|[maximum-subarray](https://leetcode.com/problems/maximum-subarray)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0053-maximum-subarray/maximum-subarray.py)|[:memo:](https://leetcode.com/articles/maximum-subarray/)|Easy| |54|[spiral-matrix](https://leetcode.com/problems/spiral-matrix)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0054-spiral-matrix/spiral-matrix.py)|[:memo:](https://leetcode.com/articles/spiral-matrix/)|Medium| |55|[jump-game](https://leetcode.com/problems/jump-game)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0055-jump-game/jump-game.py)|[:memo:](https://leetcode.com/articles/jump-game/)|Medium| |56|[merge-intervals](https://leetcode.com/problems/merge-intervals)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0056-merge-intervals/merge-intervals.py)|[:memo:](https://leetcode.com/articles/merge-intervals/)|Medium| -|57|[insert-interval](https://leetcode.com/problems/insert-interval)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0057-insert-interval/insert-interval.py)||Hard| +|57|[insert-interval](https://leetcode.com/problems/insert-interval)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0057-insert-interval/insert-interval.py)|[:memo:](https://leetcode.com/articles/insert-interval/)|Hard| |58|[length-of-last-word](https://leetcode.com/problems/length-of-last-word)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0058-length-of-last-word/length-of-last-word.py)||Easy| |59|[spiral-matrix-ii](https://leetcode.com/problems/spiral-matrix-ii)|||Medium| |60|[permutation-sequence](https://leetcode.com/problems/permutation-sequence)|||Medium| @@ -84,13 +84,13 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |66|[plus-one](https://leetcode.com/problems/plus-one)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0066-plus-one/plus-one.py)||Easy| |67|[add-binary](https://leetcode.com/problems/add-binary)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0067-add-binary/add-binary.py)||Easy| |68|[text-justification](https://leetcode.com/problems/text-justification)|||Hard| -|69|[sqrtx](https://leetcode.com/problems/sqrtx)|||Easy| +|69|[sqrtx](https://leetcode.com/problems/sqrtx)||[:memo:](https://leetcode.com/articles/sqrtx/)|Easy| |70|[climbing-stairs](https://leetcode.com/problems/climbing-stairs)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0070-climbing-stairs/climbing-stairs.py)|[:memo:](https://leetcode.com/articles/climbing-stairs/)|Easy| |71|[simplify-path](https://leetcode.com/problems/simplify-path)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0071-simplify-path/simplify-path.py)||Medium| |72|[edit-distance](https://leetcode.com/problems/edit-distance)||[:memo:](https://leetcode.com/articles/edit-distance/)|Hard| |73|[set-matrix-zeroes](https://leetcode.com/problems/set-matrix-zeroes)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0073-set-matrix-zeroes/set-matrix-zeroes.py)|[:memo:](https://leetcode.com/articles/set-matrix-zeroes/)|Medium| -|74|[search-a-2d-matrix](https://leetcode.com/problems/search-a-2d-matrix)|||Medium| -|75|[sort-colors](https://leetcode.com/problems/sort-colors)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0075-sort-colors/sort-colors.py)||Medium| +|74|[search-a-2d-matrix](https://leetcode.com/problems/search-a-2d-matrix)||[:memo:](https://leetcode.com/articles/search-in-2d-matrix/)|Medium| +|75|[sort-colors](https://leetcode.com/problems/sort-colors)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0075-sort-colors/sort-colors.py)|[:memo:](https://leetcode.com/articles/sort-colors/)|Medium| |76|[minimum-window-substring](https://leetcode.com/problems/minimum-window-substring)||[:memo:](https://leetcode.com/articles/minimum-window-substring/)|Hard| |77|[combinations](https://leetcode.com/problems/combinations)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0077-combinations/combinations.py)|[:memo:](https://leetcode.com/articles/combinations/)|Medium| |78|[subsets](https://leetcode.com/problems/subsets)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0078-subsets/subsets.py)||Medium| @@ -114,14 +114,14 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |96|[unique-binary-search-trees](https://leetcode.com/problems/unique-binary-search-trees)||[:memo:](https://leetcode.com/articles/unique-binary-search-trees/)|Medium| |97|[interleaving-string](https://leetcode.com/problems/interleaving-string)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0097-interleaving-string/interleaving-string.py)|[:memo:](https://leetcode.com/articles/interleaving-strings/)|Hard| |98|[validate-binary-search-tree](https://leetcode.com/problems/validate-binary-search-tree)||[:memo:](https://leetcode.com/articles/validate-binary-search-tree/)|Medium| -|99|[recover-binary-search-tree](https://leetcode.com/problems/recover-binary-search-tree)|||Hard| +|99|[recover-binary-search-tree](https://leetcode.com/problems/recover-binary-search-tree)||[:memo:](https://leetcode.com/articles/recover-binary-search-tree/)|Hard| |100|[same-tree](https://leetcode.com/problems/same-tree)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0100-same-tree/same-tree.py)|[:memo:](https://leetcode.com/articles/same-tree/)|Easy| |101|[symmetric-tree](https://leetcode.com/problems/symmetric-tree)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0101-symmetric-tree/symmetric-tree.py)|[:memo:](https://leetcode.com/articles/symmetric-tree/)|Easy| |102|[binary-tree-level-order-traversal](https://leetcode.com/problems/binary-tree-level-order-traversal)||[:memo:](https://leetcode.com/articles/binary-tree-level-order-traversal/)|Medium| |103|[binary-tree-zigzag-level-order-traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal)|||Medium| |104|[maximum-depth-of-binary-tree](https://leetcode.com/problems/maximum-depth-of-binary-tree)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0104-maximum-depth-of-binary-tree/maximum-depth-of-binary-tree.py)|[:memo:](https://leetcode.com/articles/maximum-depth-of-binary-tree/)|Easy| |105|[construct-binary-tree-from-preorder-and-inorder-traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal)||[:memo:](https://leetcode.com/articles/construct-binary-tree-from-preorder-and-inorder-tr/)|Medium| -|106|[construct-binary-tree-from-inorder-and-postorder-traversal](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal)|||Medium| +|106|[construct-binary-tree-from-inorder-and-postorder-traversal](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal)||[:memo:](https://leetcode.com/articles/construct-binary-tree-from-inorder-and-postorder-t/)|Medium| |107|[binary-tree-level-order-traversal-ii](https://leetcode.com/problems/binary-tree-level-order-traversal-ii)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0107-binary-tree-level-order-traversal-ii/binary-tree-level-order-traversal-ii.py)||Easy| |108|[convert-sorted-array-to-binary-search-tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0108-convert-sorted-array-to-binary-search-tree/convert-sorted-array-to-binary-search-tree.py)||Easy| |109|[convert-sorted-list-to-binary-search-tree](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree)||[:memo:](https://leetcode.com/articles/convert-sorted-list-to-binary-search-tree/)|Medium| @@ -152,16 +152,16 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |134|[gas-station](https://leetcode.com/problems/gas-station)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0134-gas-station/gas-station.py)|[:memo:](https://leetcode.com/articles/gas-station/)|Medium| |135|[candy](https://leetcode.com/problems/candy)||[:memo:](https://leetcode.com/articles/candy/)|Hard| |136|[single-number](https://leetcode.com/problems/single-number)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0136-single-number/single-number.py)|[:memo:](https://leetcode.com/articles/single-number/)|Easy| -|137|[single-number-ii](https://leetcode.com/problems/single-number-ii)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0137-single-number-ii/single-number-ii.py)||Medium| +|137|[single-number-ii](https://leetcode.com/problems/single-number-ii)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0137-single-number-ii/single-number-ii.py)|[:memo:](https://leetcode.com/articles/single-number-ii/)|Medium| |138|[copy-list-with-random-pointer](https://leetcode.com/problems/copy-list-with-random-pointer)||[:memo:](https://leetcode.com/articles/copy-list-with-random-pointer/)|Medium| |139|[word-break](https://leetcode.com/problems/word-break)||[:memo:](https://leetcode.com/articles/word-break/)|Medium| |140|[word-break-ii](https://leetcode.com/problems/word-break-ii)||[:memo:](https://leetcode.com/articles/word-break-ii/)|Hard| -|141|[linked-list-cycle](https://leetcode.com/problems/linked-list-cycle)||[:memo:](https://leetcode.com/articles/linked-list-cycle/)|Easy| +|141|[linked-list-cycle](https://leetcode.com/problems/linked-list-cycle)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0141-linked-list-cycle/linked-list-cycle.py)|[:memo:](https://leetcode.com/articles/linked-list-cycle/)|Easy| |142|[linked-list-cycle-ii](https://leetcode.com/problems/linked-list-cycle-ii)||[:memo:](https://leetcode.com/articles/linked-list-cycle-ii/)|Medium| |143|[reorder-list](https://leetcode.com/problems/reorder-list)|||Medium| |144|[binary-tree-preorder-traversal](https://leetcode.com/problems/binary-tree-preorder-traversal)||[:memo:](https://leetcode.com/articles/binary-tree-preorder-transversal/)|Medium| |145|[binary-tree-postorder-traversal](https://leetcode.com/problems/binary-tree-postorder-traversal)||[:memo:](https://leetcode.com/articles/binary-tree-postorder-transversal/)|Hard| -|146|[lru-cache](https://leetcode.com/problems/lru-cache)||[:memo:](https://leetcode.com/articles/lru-cache/)|Hard| +|146|[lru-cache](https://leetcode.com/problems/lru-cache)||[:memo:](https://leetcode.com/articles/lru-cache/)|Medium| |147|[insertion-sort-list](https://leetcode.com/problems/insertion-sort-list)|||Medium| |148|[sort-list](https://leetcode.com/problems/sort-list)|||Medium| |149|[max-points-on-a-line](https://leetcode.com/problems/max-points-on-a-line)||[:memo:](https://leetcode.com/articles/max-points-on-a-line/)|Hard| @@ -188,7 +188,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |170|[two-sum-iii-data-structure-design](https://leetcode.com/problems/two-sum-iii-data-structure-design)|:lock:||Easy| |171|[excel-sheet-column-number](https://leetcode.com/problems/excel-sheet-column-number)|||Easy| |172|[factorial-trailing-zeroes](https://leetcode.com/problems/factorial-trailing-zeroes)|||Easy| -|173|[binary-search-tree-iterator](https://leetcode.com/problems/binary-search-tree-iterator)|||Medium| +|173|[binary-search-tree-iterator](https://leetcode.com/problems/binary-search-tree-iterator)||[:memo:](https://leetcode.com/articles/binary-search-tree-iterator/)|Medium| |174|[dungeon-game](https://leetcode.com/problems/dungeon-game)|||Hard| |179|[largest-number](https://leetcode.com/problems/largest-number)||[:memo:](https://leetcode.com/articles/largest-number/)|Medium| |186|[reverse-words-in-a-string-ii](https://leetcode.com/problems/reverse-words-in-a-string-ii)|:lock:||Medium| @@ -221,23 +221,23 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |219|[contains-duplicate-ii](https://leetcode.com/problems/contains-duplicate-ii)||[:memo:](https://leetcode.com/articles/contains-duplicate-ii/)|Easy| |220|[contains-duplicate-iii](https://leetcode.com/problems/contains-duplicate-iii)||[:memo:](https://leetcode.com/articles/contains-duplicate-iii/)|Medium| |221|[maximal-square](https://leetcode.com/problems/maximal-square)||[:memo:](https://leetcode.com/articles/maximal-square/)|Medium| -|222|[count-complete-tree-nodes](https://leetcode.com/problems/count-complete-tree-nodes)|||Medium| +|222|[count-complete-tree-nodes](https://leetcode.com/problems/count-complete-tree-nodes)||[:memo:](https://leetcode.com/articles/count-complete-tree-nodes/)|Medium| |223|[rectangle-area](https://leetcode.com/problems/rectangle-area)|||Medium| -|224|[basic-calculator](https://leetcode.com/problems/basic-calculator)|||Hard| +|224|[basic-calculator](https://leetcode.com/problems/basic-calculator)||[:memo:](https://leetcode.com/articles/basic-calculator/)|Hard| |225|[implement-stack-using-queues](https://leetcode.com/problems/implement-stack-using-queues)||[:memo:](https://leetcode.com/articles/implement-stack-using-queues/)|Easy| |226|[invert-binary-tree](https://leetcode.com/problems/invert-binary-tree)||[:memo:](https://leetcode.com/articles/invert-binary-tree/)|Easy| |227|[basic-calculator-ii](https://leetcode.com/problems/basic-calculator-ii)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0227-basic-calculator-ii/basic-calculator-ii.py)||Medium| |228|[summary-ranges](https://leetcode.com/problems/summary-ranges)||[:memo:](https://leetcode.com/articles/summary-ranges/)|Medium| |229|[majority-element-ii](https://leetcode.com/problems/majority-element-ii)|||Medium| -|230|[kth-smallest-element-in-a-bst](https://leetcode.com/problems/kth-smallest-element-in-a-bst)|||Medium| -|231|[power-of-two](https://leetcode.com/problems/power-of-two)|||Easy| +|230|[kth-smallest-element-in-a-bst](https://leetcode.com/problems/kth-smallest-element-in-a-bst)||[:memo:](https://leetcode.com/articles/kth-smallest-element-in-a-bst/)|Medium| +|231|[power-of-two](https://leetcode.com/problems/power-of-two)||[:memo:](https://leetcode.com/articles/power-of-two/)|Easy| |232|[implement-queue-using-stacks](https://leetcode.com/problems/implement-queue-using-stacks)||[:memo:](https://leetcode.com/articles/implement-queue-using-stacks/)|Easy| |233|[number-of-digit-one](https://leetcode.com/problems/number-of-digit-one)||[:memo:](https://leetcode.com/articles/number-of-digit-one/)|Hard| |234|[palindrome-linked-list](https://leetcode.com/problems/palindrome-linked-list)|||Easy| |235|[lowest-common-ancestor-of-a-binary-search-tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree)||[:memo:](https://leetcode.com/articles/lowest-common-ancestor-of-a-binary-search-tree/)|Easy| |236|[lowest-common-ancestor-of-a-binary-tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree)||[:memo:](https://leetcode.com/articles/lowest-common-ancestor-of-a-binary-tree/)|Medium| |237|[delete-node-in-a-linked-list](https://leetcode.com/problems/delete-node-in-a-linked-list)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0237-delete-node-in-a-linked-list/delete-node-in-a-linked-list.py)|[:memo:](https://leetcode.com/articles/delete-node-linked-list/)|Easy| -|238|[product-of-array-except-self](https://leetcode.com/problems/product-of-array-except-self)|||Medium| +|238|[product-of-array-except-self](https://leetcode.com/problems/product-of-array-except-self)||[:memo:](https://leetcode.com/articles/product-of-array-except-self/)|Medium| |239|[sliding-window-maximum](https://leetcode.com/problems/sliding-window-maximum)||[:memo:](https://leetcode.com/articles/sliding-window-maximum/)|Hard| |240|[search-a-2d-matrix-ii](https://leetcode.com/problems/search-a-2d-matrix-ii)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0240-search-a-2d-matrix-ii/search-a-2d-matrix-ii.py)|[:memo:](https://leetcode.com/articles/search-a-2d-matrix-ii/)|Medium| |241|[different-ways-to-add-parentheses](https://leetcode.com/problems/different-ways-to-add-parentheses)|||Medium| @@ -262,18 +262,18 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |260|[single-number-iii](https://leetcode.com/problems/single-number-iii)|||Medium| |261|[graph-valid-tree](https://leetcode.com/problems/graph-valid-tree)|:lock:||Medium| |263|[ugly-number](https://leetcode.com/problems/ugly-number)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0263-ugly-number/ugly-number.py)||Easy| -|264|[ugly-number-ii](https://leetcode.com/problems/ugly-number-ii)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0264-ugly-number-ii/ugly-number-ii.py)||Medium| +|264|[ugly-number-ii](https://leetcode.com/problems/ugly-number-ii)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0264-ugly-number-ii/ugly-number-ii.py)|[:memo:](https://leetcode.com/articles/ugly-number-ii/)|Medium| |265|[paint-house-ii](https://leetcode.com/problems/paint-house-ii)|:lock:||Hard| |266|[palindrome-permutation](https://leetcode.com/problems/palindrome-permutation)|:lock:|[:memo:](https://leetcode.com/articles/palindrome-permutation/)|Easy| |267|[palindrome-permutation-ii](https://leetcode.com/problems/palindrome-permutation-ii)|:lock:|[:memo:](https://leetcode.com/articles/palindrome-permutation-ii/)|Medium| |268|[missing-number](https://leetcode.com/problems/missing-number)||[:memo:](https://leetcode.com/articles/missing-number/)|Easy| |269|[alien-dictionary](https://leetcode.com/problems/alien-dictionary)|:lock:||Hard| -|270|[closest-binary-search-tree-value](https://leetcode.com/problems/closest-binary-search-tree-value)|:lock:||Easy| -|271|[encode-and-decode-strings](https://leetcode.com/problems/encode-and-decode-strings)|:lock:||Medium| +|270|[closest-binary-search-tree-value](https://leetcode.com/problems/closest-binary-search-tree-value)|:lock:|[:memo:](https://leetcode.com/articles/closest-bst-value/)|Easy| +|271|[encode-and-decode-strings](https://leetcode.com/problems/encode-and-decode-strings)|:lock:|[:memo:](https://leetcode.com/articles/encode-and-decode-strings/)|Medium| |272|[closest-binary-search-tree-value-ii](https://leetcode.com/problems/closest-binary-search-tree-value-ii)|:lock:||Hard| |273|[integer-to-english-words](https://leetcode.com/problems/integer-to-english-words)||[:memo:](https://leetcode.com/articles/integer-to-english-words/)|Hard| |274|[h-index](https://leetcode.com/problems/h-index)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0274-h-index/h-index.py)|[:memo:](https://leetcode.com/articles/h-index/)|Medium| -|275|[h-index-ii](https://leetcode.com/problems/h-index-ii)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0275-h-index-ii/h-index-ii.py)||Medium| +|275|[h-index-ii](https://leetcode.com/problems/h-index-ii)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0275-h-index-ii/h-index-ii.py)|[:memo:](https://leetcode.com/articles/h-index-ii/)|Medium| |276|[paint-fence](https://leetcode.com/problems/paint-fence)|:lock:||Easy| |277|[find-the-celebrity](https://leetcode.com/problems/find-the-celebrity)|:lock:||Medium| |278|[first-bad-version](https://leetcode.com/problems/first-bad-version)||[:memo:](https://leetcode.com/articles/first-bad-version/)|Easy| @@ -283,11 +283,11 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |282|[expression-add-operators](https://leetcode.com/problems/expression-add-operators)||[:memo:](https://leetcode.com/articles/expression-add-operators/)|Hard| |283|[move-zeroes](https://leetcode.com/problems/move-zeroes)||[:memo:](https://leetcode.com/articles/move-zeroes/)|Easy| |284|[peeking-iterator](https://leetcode.com/problems/peeking-iterator)|||Medium| -|285|[inorder-successor-in-bst](https://leetcode.com/problems/inorder-successor-in-bst)|:lock:||Medium| +|285|[inorder-successor-in-bst](https://leetcode.com/problems/inorder-successor-in-bst)|:lock:|[:memo:](https://leetcode.com/articles/inorder-successor-in-bst/)|Medium| |286|[walls-and-gates](https://leetcode.com/problems/walls-and-gates)|:lock:|[:memo:](https://leetcode.com/articles/walls-and-gates/)|Medium| |287|[find-the-duplicate-number](https://leetcode.com/problems/find-the-duplicate-number)||[:memo:](https://leetcode.com/articles/find-the-duplicate-number/)|Medium| |288|[unique-word-abbreviation](https://leetcode.com/problems/unique-word-abbreviation)|:lock:|[:memo:](https://leetcode.com/articles/unique-word-abbreviation/)|Medium| -|289|[game-of-life](https://leetcode.com/problems/game-of-life)|||Medium| +|289|[game-of-life](https://leetcode.com/problems/game-of-life)||[:memo:](https://leetcode.com/articles/game-of-life/)|Medium| |290|[word-pattern](https://leetcode.com/problems/word-pattern)|||Easy| |291|[word-pattern-ii](https://leetcode.com/problems/word-pattern-ii)|:lock:||Hard| |292|[nim-game](https://leetcode.com/problems/nim-game)||[:memo:](https://leetcode.com/articles/nim-game/)|Easy| @@ -297,7 +297,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |296|[best-meeting-point](https://leetcode.com/problems/best-meeting-point)|:lock:|[:memo:](https://leetcode.com/articles/best-meeting-point/)|Hard| |297|[serialize-and-deserialize-binary-tree](https://leetcode.com/problems/serialize-and-deserialize-binary-tree)||[:memo:](https://leetcode.com/articles/serialize-and-deserialize-binary-tree/)|Hard| |298|[binary-tree-longest-consecutive-sequence](https://leetcode.com/problems/binary-tree-longest-consecutive-sequence)|:lock:|[:memo:](https://leetcode.com/articles/binary-tree-longest-consecutive-sequence/)|Medium| -|299|[bulls-and-cows](https://leetcode.com/problems/bulls-and-cows)|||Medium| +|299|[bulls-and-cows](https://leetcode.com/problems/bulls-and-cows)|||Easy| |300|[longest-increasing-subsequence](https://leetcode.com/problems/longest-increasing-subsequence)||[:memo:](https://leetcode.com/articles/longest-increasing-subsequence/)|Medium| |301|[remove-invalid-parentheses](https://leetcode.com/problems/remove-invalid-parentheses)||[:memo:](https://leetcode.com/articles/remove-invalid-parentheses/)|Hard| |302|[smallest-rectangle-enclosing-black-pixels](https://leetcode.com/problems/smallest-rectangle-enclosing-black-pixels)|:lock:|[:memo:](https://leetcode.com/articles/smallest-rectangle-enclosing-black-pixels/)|Hard| @@ -310,13 +310,13 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |309|[best-time-to-buy-and-sell-stock-with-cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown)|||Medium| |310|[minimum-height-trees](https://leetcode.com/problems/minimum-height-trees)|||Medium| |311|[sparse-matrix-multiplication](https://leetcode.com/problems/sparse-matrix-multiplication)|:lock:||Medium| -|312|[burst-balloons](https://leetcode.com/problems/burst-balloons)|||Hard| +|312|[burst-balloons](https://leetcode.com/problems/burst-balloons)||[:memo:](https://leetcode.com/articles/burst-balloons/)|Hard| |313|[super-ugly-number](https://leetcode.com/problems/super-ugly-number)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0313-super-ugly-number/super-ugly-number.py)||Medium| |314|[binary-tree-vertical-order-traversal](https://leetcode.com/problems/binary-tree-vertical-order-traversal)|:lock:||Medium| |315|[count-of-smaller-numbers-after-self](https://leetcode.com/problems/count-of-smaller-numbers-after-self)|||Hard| -|316|[remove-duplicate-letters](https://leetcode.com/problems/remove-duplicate-letters)|||Hard| +|316|[remove-duplicate-letters](https://leetcode.com/problems/remove-duplicate-letters)||[:memo:](https://leetcode.com/articles/remove-duplicate-letters/)|Hard| |317|[shortest-distance-from-all-buildings](https://leetcode.com/problems/shortest-distance-from-all-buildings)|:lock:||Hard| -|318|[maximum-product-of-word-lengths](https://leetcode.com/problems/maximum-product-of-word-lengths)|||Medium| +|318|[maximum-product-of-word-lengths](https://leetcode.com/problems/maximum-product-of-word-lengths)||[:memo:](https://leetcode.com/articles/maximum-product-of-word-lengths/)|Medium| |319|[bulb-switcher](https://leetcode.com/problems/bulb-switcher)|||Medium| |320|[generalized-abbreviation](https://leetcode.com/problems/generalized-abbreviation)|:lock:|[:memo:](https://leetcode.com/articles/generalized-abbreviation/)|Medium| |321|[create-maximum-number](https://leetcode.com/problems/create-maximum-number)|||Hard| @@ -329,7 +329,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |328|[odd-even-linked-list](https://leetcode.com/problems/odd-even-linked-list)||[:memo:](https://leetcode.com/articles/odd-even-linked-list/)|Medium| |329|[longest-increasing-path-in-a-matrix](https://leetcode.com/problems/longest-increasing-path-in-a-matrix)||[:memo:](https://leetcode.com/articles/longest-increasing-path-matrix/)|Hard| |330|[patching-array](https://leetcode.com/problems/patching-array)||[:memo:](https://leetcode.com/articles/patching-array/)|Hard| -|331|[verify-preorder-serialization-of-a-binary-tree](https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree)|||Medium| +|331|[verify-preorder-serialization-of-a-binary-tree](https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree)||[:memo:](https://leetcode.com/articles/verify-preorder-serialization-of-a-binary-tree/)|Medium| |332|[reconstruct-itinerary](https://leetcode.com/problems/reconstruct-itinerary)|||Medium| |333|[largest-bst-subtree](https://leetcode.com/problems/largest-bst-subtree)|:lock:||Medium| |334|[increasing-triplet-subsequence](https://leetcode.com/problems/increasing-triplet-subsequence)|||Medium| @@ -379,7 +379,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |378|[kth-smallest-element-in-a-sorted-matrix](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix)|||Medium| |379|[design-phone-directory](https://leetcode.com/problems/design-phone-directory)|:lock:||Medium| |380|[insert-delete-getrandom-o1](https://leetcode.com/problems/insert-delete-getrandom-o1)|||Medium| -|381|[insert-delete-getrandom-o1-duplicates-allowed](https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed)|||Hard| +|381|[insert-delete-getrandom-o1-duplicates-allowed](https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed)||[:memo:](https://leetcode.com/articles/insert-delete-getrandom-o1-duplicates-allowed/)|Hard| |382|[linked-list-random-node](https://leetcode.com/problems/linked-list-random-node)|||Medium| |383|[ransom-note](https://leetcode.com/problems/ransom-note)|||Easy| |384|[shuffle-an-array](https://leetcode.com/problems/shuffle-an-array)||[:memo:](https://leetcode.com/articles/shuffle-an-array/)|Medium| @@ -390,7 +390,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |389|[find-the-difference](https://leetcode.com/problems/find-the-difference)|||Easy| |390|[elimination-game](https://leetcode.com/problems/elimination-game)|||Medium| |391|[perfect-rectangle](https://leetcode.com/problems/perfect-rectangle)|||Hard| -|392|[is-subsequence](https://leetcode.com/problems/is-subsequence)|||Medium| +|392|[is-subsequence](https://leetcode.com/problems/is-subsequence)|||Easy| |393|[utf-8-validation](https://leetcode.com/problems/utf-8-validation)||[:memo:](https://leetcode.com/articles/utf-8-validation/)|Medium| |394|[decode-string](https://leetcode.com/problems/decode-string)|||Medium| |395|[longest-substring-with-at-least-k-repeating-characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters)|||Medium| @@ -398,13 +398,13 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |397|[integer-replacement](https://leetcode.com/problems/integer-replacement)|||Medium| |398|[random-pick-index](https://leetcode.com/problems/random-pick-index)|||Medium| |399|[evaluate-division](https://leetcode.com/problems/evaluate-division)|||Medium| -|400|[nth-digit](https://leetcode.com/problems/nth-digit)|||Easy| +|400|[nth-digit](https://leetcode.com/problems/nth-digit)|||Medium| |401|[binary-watch](https://leetcode.com/problems/binary-watch)|||Easy| |402|[remove-k-digits](https://leetcode.com/problems/remove-k-digits)|||Medium| |403|[frog-jump](https://leetcode.com/problems/frog-jump)||[:memo:](https://leetcode.com/articles/frog-jump/)|Hard| |404|[sum-of-left-leaves](https://leetcode.com/problems/sum-of-left-leaves)|||Easy| |405|[convert-a-number-to-hexadecimal](https://leetcode.com/problems/convert-a-number-to-hexadecimal)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0405-convert-a-number-to-hexadecimal/convert-a-number-to-hexadecimal.py)||Easy| -|406|[queue-reconstruction-by-height](https://leetcode.com/problems/queue-reconstruction-by-height)|||Medium| +|406|[queue-reconstruction-by-height](https://leetcode.com/problems/queue-reconstruction-by-height)||[:memo:](https://leetcode.com/articles/queue-reconstruction-by-height/)|Medium| |407|[trapping-rain-water-ii](https://leetcode.com/problems/trapping-rain-water-ii)|||Hard| |408|[valid-word-abbreviation](https://leetcode.com/problems/valid-word-abbreviation)|:lock:||Easy| |409|[longest-palindrome](https://leetcode.com/problems/longest-palindrome)||[:memo:](https://leetcode.com/articles/longest-palindrome/)|Easy| @@ -430,7 +430,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |435|[non-overlapping-intervals](https://leetcode.com/problems/non-overlapping-intervals)||[:memo:](https://leetcode.com/articles/non-overlapping-intervals/)|Medium| |436|[find-right-interval](https://leetcode.com/problems/find-right-interval)||[:memo:](https://leetcode.com/articles/find-right-interval/)|Medium| |437|[path-sum-iii](https://leetcode.com/problems/path-sum-iii)|||Easy| -|438|[find-all-anagrams-in-a-string](https://leetcode.com/problems/find-all-anagrams-in-a-string)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0438-find-all-anagrams-in-a-string/find-all-anagrams-in-a-string.py)||Easy| +|438|[find-all-anagrams-in-a-string](https://leetcode.com/problems/find-all-anagrams-in-a-string)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0438-find-all-anagrams-in-a-string/find-all-anagrams-in-a-string.py)||Medium| |439|[ternary-expression-parser](https://leetcode.com/problems/ternary-expression-parser)|:lock:||Medium| |440|[k-th-smallest-in-lexicographical-order](https://leetcode.com/problems/k-th-smallest-in-lexicographical-order)|||Hard| |441|[arranging-coins](https://leetcode.com/problems/arranging-coins)|||Easy| @@ -441,16 +441,16 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |446|[arithmetic-slices-ii-subsequence](https://leetcode.com/problems/arithmetic-slices-ii-subsequence)||[:memo:](https://leetcode.com/articles/arithmetic-slices-ii-subsequence/)|Hard| |447|[number-of-boomerangs](https://leetcode.com/problems/number-of-boomerangs)|||Easy| |448|[find-all-numbers-disappeared-in-an-array](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array)|||Easy| -|449|[serialize-and-deserialize-bst](https://leetcode.com/problems/serialize-and-deserialize-bst)|||Medium| -|450|[delete-node-in-a-bst](https://leetcode.com/problems/delete-node-in-a-bst)|||Medium| +|449|[serialize-and-deserialize-bst](https://leetcode.com/problems/serialize-and-deserialize-bst)||[:memo:](https://leetcode.com/articles/serialize-and-deserialize-bst/)|Medium| +|450|[delete-node-in-a-bst](https://leetcode.com/problems/delete-node-in-a-bst)||[:memo:](https://leetcode.com/articles/delete-node-in-a-bst/)|Medium| |451|[sort-characters-by-frequency](https://leetcode.com/problems/sort-characters-by-frequency)|||Medium| -|452|[minimum-number-of-arrows-to-burst-balloons](https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons)|||Medium| +|452|[minimum-number-of-arrows-to-burst-balloons](https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons)||[:memo:](https://leetcode.com/articles/minimum-number-of-arrows-to-burst-balloons/)|Medium| |453|[minimum-moves-to-equal-array-elements](https://leetcode.com/problems/minimum-moves-to-equal-array-elements)||[:memo:](https://leetcode.com/articles/minimum-moves-to-equal-array-elements/)|Easy| |454|[4sum-ii](https://leetcode.com/problems/4sum-ii)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0454-4sum-ii/4sum-ii.py)||Medium| |455|[assign-cookies](https://leetcode.com/problems/assign-cookies)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0455-assign-cookies/assign-cookies.py)||Easy| |456|[132-pattern](https://leetcode.com/problems/132-pattern)||[:memo:](https://leetcode.com/articles/132-pattern/)|Medium| |457|[circular-array-loop](https://leetcode.com/problems/circular-array-loop)|||Medium| -|458|[poor-pigs](https://leetcode.com/problems/poor-pigs)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0458-poor-pigs/poor-pigs.py)||Hard| +|458|[poor-pigs](https://leetcode.com/problems/poor-pigs)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0458-poor-pigs/poor-pigs.py)|[:memo:](https://leetcode.com/articles/poor-pigs/)|Hard| |459|[repeated-substring-pattern](https://leetcode.com/problems/repeated-substring-pattern)|||Easy| |460|[lfu-cache](https://leetcode.com/problems/lfu-cache)|||Hard| |461|[hamming-distance](https://leetcode.com/problems/hamming-distance)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0461-hamming-distance/hamming-distance.py)||Easy| @@ -484,25 +484,26 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |492|[construct-the-rectangle](https://leetcode.com/problems/construct-the-rectangle)|||Easy| |493|[reverse-pairs](https://leetcode.com/problems/reverse-pairs)||[:memo:](https://leetcode.com/articles/reverse-pairs/)|Hard| |494|[target-sum](https://leetcode.com/problems/target-sum)||[:memo:](https://leetcode.com/articles/target-sum/)|Medium| -|495|[teemo-attacking](https://leetcode.com/problems/teemo-attacking)|||Medium| +|495|[teemo-attacking](https://leetcode.com/problems/teemo-attacking)||[:memo:](https://leetcode.com/articles/teemo-attacking/)|Medium| |496|[next-greater-element-i](https://leetcode.com/problems/next-greater-element-i)||[:memo:](https://leetcode.com/articles/greater-element-i/)|Easy| |498|[diagonal-traverse](https://leetcode.com/problems/diagonal-traverse)|||Medium| |499|[the-maze-iii](https://leetcode.com/problems/the-maze-iii)|:lock:||Hard| |500|[keyboard-row](https://leetcode.com/problems/keyboard-row)|||Easy| |501|[find-mode-in-binary-search-tree](https://leetcode.com/problems/find-mode-in-binary-search-tree)|||Easy| -|502|[ipo](https://leetcode.com/problems/ipo)|||Hard| +|502|[ipo](https://leetcode.com/problems/ipo)||[:memo:](https://leetcode.com/articles/ipo/)|Hard| |503|[next-greater-element-ii](https://leetcode.com/problems/next-greater-element-ii)||[:memo:](https://leetcode.com/articles/next-greater-element-ii/)|Medium| |504|[base-7](https://leetcode.com/problems/base-7)|||Easy| |505|[the-maze-ii](https://leetcode.com/problems/the-maze-ii)|:lock:|[:memo:](https://leetcode.com/articles/the-maze-ii/)|Medium| |506|[relative-ranks](https://leetcode.com/problems/relative-ranks)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/0506-relative-ranks/relative-ranks.py)||Easy| |507|[perfect-number](https://leetcode.com/problems/perfect-number)||[:memo:](https://leetcode.com/articles/perfect-number/)|Easy| |508|[most-frequent-subtree-sum](https://leetcode.com/problems/most-frequent-subtree-sum)|||Medium| -|509|[inorder-successor-in-bst-ii](https://leetcode.com/problems/inorder-successor-in-bst-ii)|:lock:||Medium| +|509|[inorder-successor-in-bst-ii](https://leetcode.com/problems/inorder-successor-in-bst-ii)|:lock:|[:memo:](https://leetcode.com/articles/inorder-successor-in-a-bst-ii/)|Medium| +|511|[all-paths-from-source-lead-to-destination](https://leetcode.com/problems/all-paths-from-source-lead-to-destination)|:lock:||Medium| |513|[find-bottom-left-tree-value](https://leetcode.com/problems/find-bottom-left-tree-value)|||Medium| |514|[freedom-trail](https://leetcode.com/problems/freedom-trail)|||Hard| |515|[find-largest-value-in-each-tree-row](https://leetcode.com/problems/find-largest-value-in-each-tree-row)|||Medium| |516|[longest-palindromic-subsequence](https://leetcode.com/problems/longest-palindromic-subsequence)|||Medium| -|517|[super-washing-machines](https://leetcode.com/problems/super-washing-machines)|||Hard| +|517|[super-washing-machines](https://leetcode.com/problems/super-washing-machines)||[:memo:](https://leetcode.com/articles/super-washing-machines/)|Hard| |518|[coin-change-2](https://leetcode.com/problems/coin-change-2)|||Medium| |520|[detect-capital](https://leetcode.com/problems/detect-capital)|||Easy| |521|[longest-uncommon-subsequence-i](https://leetcode.com/problems/longest-uncommon-subsequence-i)||[:memo:](https://leetcode.com/articles/longest-uncommon-subsequence-i/)|Easy| @@ -579,7 +580,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |629|[k-inverse-pairs-array](https://leetcode.com/problems/k-inverse-pairs-array)||[:memo:](https://leetcode.com/articles/k-inverse-pairs-array/)|Hard| |630|[course-schedule-iii](https://leetcode.com/problems/course-schedule-iii)||[:memo:](https://leetcode.com/articles/course-schedule-iii/)|Hard| |631|[design-excel-sum-formula](https://leetcode.com/problems/design-excel-sum-formula)|:lock:|[:memo:](https://leetcode.com/articles/design-excel-sum-formula/)|Hard| -|632|[smallest-range](https://leetcode.com/problems/smallest-range)||[:memo:](https://leetcode.com/articles/smallest-range/)|Hard| +|632|[smallest-range-covering-elements-from-k-lists](https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists)||[:memo:](https://leetcode.com/articles/smallest-range/)|Hard| |633|[sum-of-square-numbers](https://leetcode.com/problems/sum-of-square-numbers)||[:memo:](https://leetcode.com/articles/sum-of-square-numbers/)|Easy| |634|[find-the-derangement-of-an-array](https://leetcode.com/problems/find-the-derangement-of-an-array)|:lock:|[:memo:](https://leetcode.com/articles/find-derangements/)|Medium| |635|[design-log-storage-system](https://leetcode.com/problems/design-log-storage-system)|:lock:|[:memo:](https://leetcode.com/articles/design-log-storage/)|Medium| @@ -707,7 +708,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |769|[largest-plus-sign](https://leetcode.com/problems/largest-plus-sign)||[:memo:](https://leetcode.com/articles/largest-plus-sign/)|Medium| |770|[couples-holding-hands](https://leetcode.com/problems/couples-holding-hands)||[:memo:](https://leetcode.com/articles/couples-holding-hands/)|Hard| |771|[encode-n-ary-tree-to-binary-tree](https://leetcode.com/problems/encode-n-ary-tree-to-binary-tree)|:lock:||Hard| -|772|[construct-quad-tree](https://leetcode.com/problems/construct-quad-tree)|||Easy| +|772|[construct-quad-tree](https://leetcode.com/problems/construct-quad-tree)|||Medium| |773|[quad-tree-intersection](https://leetcode.com/problems/quad-tree-intersection)|||Easy| |774|[maximum-depth-of-n-ary-tree](https://leetcode.com/problems/maximum-depth-of-n-ary-tree)||[:memo:](https://leetcode.com/articles/maximum-depth-of-n-ary-tree/)|Easy| |775|[n-ary-tree-preorder-traversal](https://leetcode.com/problems/n-ary-tree-preorder-traversal)||[:memo:](https://leetcode.com/articles/n-ary-tree-preorder-traversal/)|Easy| @@ -719,7 +720,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |781|[basic-calculator-iv](https://leetcode.com/problems/basic-calculator-iv)||[:memo:](https://leetcode.com/articles/basic-calculator-iv/)|Hard| |782|[jewels-and-stones](https://leetcode.com/problems/jewels-and-stones)||[:memo:](https://leetcode.com/articles/jewels-and-stones/)|Easy| |783|[search-in-a-binary-search-tree](https://leetcode.com/problems/search-in-a-binary-search-tree)|||Easy| -|784|[insert-into-a-binary-search-tree](https://leetcode.com/problems/insert-into-a-binary-search-tree)|||Medium| +|784|[insert-into-a-binary-search-tree](https://leetcode.com/problems/insert-into-a-binary-search-tree)||[:memo:](https://leetcode.com/articles/insert-into-a-bst/)|Medium| |785|[basic-calculator-iii](https://leetcode.com/problems/basic-calculator-iii)|:lock:||Hard| |786|[search-in-a-sorted-array-of-unknown-size](https://leetcode.com/problems/search-in-a-sorted-array-of-unknown-size)|:lock:||Medium| |787|[sliding-puzzle](https://leetcode.com/problems/sliding-puzzle)||[:memo:](https://leetcode.com/articles/sliding-puzzle/)|Hard| @@ -727,7 +728,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |789|[kth-largest-element-in-a-stream](https://leetcode.com/problems/kth-largest-element-in-a-stream)|||Easy| |790|[global-and-local-inversions](https://leetcode.com/problems/global-and-local-inversions)||[:memo:](https://leetcode.com/articles/global-and-local-inversions/)|Medium| |791|[split-bst](https://leetcode.com/problems/split-bst)|:lock:|[:memo:](https://leetcode.com/articles/split-bst/)|Medium| -|792|[binary-search](https://leetcode.com/problems/binary-search)|||Easy| +|792|[binary-search](https://leetcode.com/problems/binary-search)||[:memo:](https://leetcode.com/articles/binary-search/)|Easy| |793|[swap-adjacent-in-lr-string](https://leetcode.com/problems/swap-adjacent-in-lr-string)||[:memo:](https://leetcode.com/articles/swap-adjacent-in-lr-string/)|Medium| |794|[swim-in-rising-water](https://leetcode.com/problems/swim-in-rising-water)||[:memo:](https://leetcode.com/articles/swim-in-rising-water/)|Hard| |795|[k-th-symbol-in-grammar](https://leetcode.com/problems/k-th-symbol-in-grammar)||[:memo:](https://leetcode.com/articles/k-th-symbol-in-grammar/)|Medium| @@ -876,6 +877,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |945|[snakes-and-ladders](https://leetcode.com/problems/snakes-and-ladders)||[:memo:](https://leetcode.com/articles/snakes-and-ladders/)|Medium| |946|[smallest-range-ii](https://leetcode.com/problems/smallest-range-ii)||[:memo:](https://leetcode.com/articles/smallest-range-ii/)|Medium| |947|[online-election](https://leetcode.com/problems/online-election)||[:memo:](https://leetcode.com/articles/online-election/)|Medium| +|948|[sort-an-array](https://leetcode.com/problems/sort-an-array)|||Medium| |949|[cat-and-mouse](https://leetcode.com/problems/cat-and-mouse)||[:memo:](https://leetcode.com/articles/cat-and-mouse-game/)|Hard| |950|[x-of-a-kind-in-a-deck-of-cards](https://leetcode.com/problems/x-of-a-kind-in-a-deck-of-cards)||[:memo:](https://leetcode.com/articles/x-of-a-kind-in-a-deck-of-cards/)|Easy| |951|[partition-array-into-disjoint-intervals](https://leetcode.com/problems/partition-array-into-disjoint-intervals)||[:memo:](https://leetcode.com/articles/parition-array-into-disjoint-intervals/)|Medium| @@ -901,7 +903,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |972|[knight-dialer](https://leetcode.com/problems/knight-dialer)||[:memo:](https://leetcode.com/articles/knight-dialer/)|Medium| |973|[stamping-the-sequence](https://leetcode.com/problems/stamping-the-sequence)||[:memo:](https://leetcode.com/articles/stamping-the-sequence/)|Hard| |974|[reorder-log-files](https://leetcode.com/problems/reorder-log-files)||[:memo:](https://leetcode.com/articles/reorder-log-files/)|Easy| -|975|[range-sum-of-bst](https://leetcode.com/problems/range-sum-of-bst)||[:memo:](https://leetcode.com/articles/range-sum-of-bst/)|Medium| +|975|[range-sum-of-bst](https://leetcode.com/problems/range-sum-of-bst)||[:memo:](https://leetcode.com/articles/range-sum-of-bst/)|Easy| |976|[minimum-area-rectangle](https://leetcode.com/problems/minimum-area-rectangle)||[:memo:](https://leetcode.com/articles/minimum-area-rectangle/)|Medium| |977|[distinct-subsequences-ii](https://leetcode.com/problems/distinct-subsequences-ii)||[:memo:](https://leetcode.com/articles/distinct-subsequences-ii/)|Hard| |978|[valid-mountain-array](https://leetcode.com/problems/valid-mountain-array)||[:memo:](https://leetcode.com/articles/valid-mountain-array/)|Easy| @@ -936,7 +938,7 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |1010|[powerful-integers](https://leetcode.com/problems/powerful-integers)||[:memo:](https://leetcode.com/articles/powerful-integers/)|Easy| |1011|[flip-binary-tree-to-match-preorder-traversal](https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal)||[:memo:](https://leetcode.com/articles/flip-binary-tree-to-match-preorder-traversal/)|Medium| |1012|[equal-rational-numbers](https://leetcode.com/problems/equal-rational-numbers)||[:memo:](https://leetcode.com/articles/equal-rational-numbers/)|Hard| -|1013|[fibonacci-number](https://leetcode.com/problems/fibonacci-number)|||Easy| +|1013|[fibonacci-number](https://leetcode.com/problems/fibonacci-number)||[:memo:](https://leetcode.com/articles/fibonacci-number/)|Easy| |1014|[k-closest-points-to-origin](https://leetcode.com/problems/k-closest-points-to-origin)||[:memo:](https://leetcode.com/articles/k-closest-points-to-origin/)|Medium| |1016|[subarray-sums-divisible-by-k](https://leetcode.com/problems/subarray-sums-divisible-by-k)||[:memo:](https://leetcode.com/articles/subarray-sums-divisible-by-k/)|Medium| |1017|[odd-even-jump](https://leetcode.com/problems/odd-even-jump)||[:memo:](https://leetcode.com/articles/odd-even-jump/)|Hard| @@ -971,21 +973,130 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to |1046|[max-consecutive-ones-iii](https://leetcode.com/problems/max-consecutive-ones-iii)|||Medium| |1047|[maximize-sum-of-array-after-k-negations](https://leetcode.com/problems/maximize-sum-of-array-after-k-negations)|||Easy| |1048|[clumsy-factorial](https://leetcode.com/problems/clumsy-factorial)|||Medium| -|1049|[minimum-domino-rotations-for-equal-row](https://leetcode.com/problems/minimum-domino-rotations-for-equal-row)|||Medium| -|1050|[construct-binary-search-tree-from-preorder-traversal](https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal)|||Medium| +|1049|[minimum-domino-rotations-for-equal-row](https://leetcode.com/problems/minimum-domino-rotations-for-equal-row)||[:memo:](https://leetcode.com/articles/minimum-domino-rotations-for-equal-row/)|Medium| +|1050|[construct-binary-search-tree-from-preorder-traversal](https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal)||[:memo:](https://leetcode.com/articles/construct-bst-from-preorder-traversal/)|Medium| +|1051|[shortest-way-to-form-string](https://leetcode.com/problems/shortest-way-to-form-string)|:lock:||Medium| +|1052|[campus-bikes](https://leetcode.com/problems/campus-bikes)|:lock:||Medium| +|1053|[minimize-rounding-error-to-meet-target](https://leetcode.com/problems/minimize-rounding-error-to-meet-target)|:lock:||Medium| |1054|[complement-of-base-10-integer](https://leetcode.com/problems/complement-of-base-10-integer)|||Easy| |1055|[pairs-of-songs-with-total-durations-divisible-by-60](https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60)|||Easy| |1056|[capacity-to-ship-packages-within-d-days](https://leetcode.com/problems/capacity-to-ship-packages-within-d-days)|||Medium| |1057|[numbers-with-repeated-digits](https://leetcode.com/problems/numbers-with-repeated-digits)|||Hard| +|1058|[lexicographically-smallest-equivalent-string](https://leetcode.com/problems/lexicographically-smallest-equivalent-string)|:lock:||Medium| +|1059|[missing-element-in-sorted-array](https://leetcode.com/problems/missing-element-in-sorted-array)|:lock:|[:memo:](https://leetcode.com/articles/missing-element-in-sorted-array/)|Medium| +|1060|[longest-repeating-substring](https://leetcode.com/problems/longest-repeating-substring)|:lock:|[:memo:](https://leetcode.com/articles/longest-repeating-substring/)|Medium| +|1061|[number-of-valid-subarrays](https://leetcode.com/problems/number-of-valid-subarrays)|:lock:||Hard| |1062|[partition-array-into-three-parts-with-equal-sum](https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum)|||Easy| |1063|[best-sightseeing-pair](https://leetcode.com/problems/best-sightseeing-pair)|||Medium| |1064|[smallest-integer-divisible-by-k](https://leetcode.com/problems/smallest-integer-divisible-by-k)|||Medium| |1065|[binary-string-with-substrings-representing-1-to-n](https://leetcode.com/problems/binary-string-with-substrings-representing-1-to-n)|[Python](https://github.com/bonfy/leetcode/blob/master/solutions/1065-binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n.py)||Medium| +|1066|[fixed-point](https://leetcode.com/problems/fixed-point)|:lock:||Easy| +|1067|[campus-bikes-ii](https://leetcode.com/problems/campus-bikes-ii)|:lock:||Medium| +|1068|[digit-count-in-range](https://leetcode.com/problems/digit-count-in-range)|:lock:||Hard| +|1069|[confusing-number](https://leetcode.com/problems/confusing-number)|:lock:||Easy| |1070|[convert-to-base-2](https://leetcode.com/problems/convert-to-base-2)|||Medium| |1071|[binary-prefix-divisible-by-5](https://leetcode.com/problems/binary-prefix-divisible-by-5)|||Easy| |1072|[next-greater-node-in-linked-list](https://leetcode.com/problems/next-greater-node-in-linked-list)|||Medium| |1073|[number-of-enclaves](https://leetcode.com/problems/number-of-enclaves)|||Medium| +|1074|[high-five](https://leetcode.com/problems/high-five)|:lock:||Easy| +|1075|[index-pairs-of-a-string](https://leetcode.com/problems/index-pairs-of-a-string)|:lock:||Easy| +|1076|[brace-expansion](https://leetcode.com/problems/brace-expansion)|:lock:||Medium| +|1077|[confusing-number-ii](https://leetcode.com/problems/confusing-number-ii)|:lock:||Hard| |1078|[remove-outermost-parentheses](https://leetcode.com/problems/remove-outermost-parentheses)|||Easy| |1079|[sum-of-root-to-leaf-binary-numbers](https://leetcode.com/problems/sum-of-root-to-leaf-binary-numbers)|||Easy| |1080|[camelcase-matching](https://leetcode.com/problems/camelcase-matching)|||Medium| |1081|[video-stitching](https://leetcode.com/problems/video-stitching)|||Medium| +|1082|[sum-of-digits-in-the-minimum-number](https://leetcode.com/problems/sum-of-digits-in-the-minimum-number)|:lock:||Easy| +|1083|[two-sum-less-than-k](https://leetcode.com/problems/two-sum-less-than-k)|:lock:||Easy| +|1084|[find-k-length-substrings-with-no-repeated-characters](https://leetcode.com/problems/find-k-length-substrings-with-no-repeated-characters)|:lock:||Medium| +|1085|[the-earliest-moment-when-everyone-become-friends](https://leetcode.com/problems/the-earliest-moment-when-everyone-become-friends)|:lock:||Medium| +|1086|[divisor-game](https://leetcode.com/problems/divisor-game)|||Easy| +|1087|[longest-arithmetic-sequence](https://leetcode.com/problems/longest-arithmetic-sequence)|||Medium| +|1088|[number-of-days-in-a-month](https://leetcode.com/problems/number-of-days-in-a-month)|:lock:||Easy| +|1089|[remove-vowels-from-a-string](https://leetcode.com/problems/remove-vowels-from-a-string)|:lock:||Easy| +|1090|[armstrong-number](https://leetcode.com/problems/armstrong-number)|:lock:||Easy| +|1091|[maximum-average-subtree](https://leetcode.com/problems/maximum-average-subtree)|:lock:||Medium| +|1092|[maximum-difference-between-node-and-ancestor](https://leetcode.com/problems/maximum-difference-between-node-and-ancestor)|||Medium| +|1093|[recover-a-tree-from-preorder-traversal](https://leetcode.com/problems/recover-a-tree-from-preorder-traversal)|||Hard| +|1094|[matrix-cells-in-distance-order](https://leetcode.com/problems/matrix-cells-in-distance-order)|||Easy| +|1095|[two-city-scheduling](https://leetcode.com/problems/two-city-scheduling)||[:memo:](https://leetcode.com/articles/two-city-scheduling/)|Easy| +|1096|[maximum-sum-of-two-non-overlapping-subarrays](https://leetcode.com/problems/maximum-sum-of-two-non-overlapping-subarrays)|||Medium| +|1097|[stream-of-characters](https://leetcode.com/problems/stream-of-characters)|||Hard| +|1098|[largest-unique-number](https://leetcode.com/problems/largest-unique-number)|:lock:||Easy| +|1099|[path-with-maximum-minimum-value](https://leetcode.com/problems/path-with-maximum-minimum-value)|:lock:||Medium| +|1100|[connecting-cities-with-minimum-cost](https://leetcode.com/problems/connecting-cities-with-minimum-cost)|:lock:||Medium| +|1101|[parallel-courses](https://leetcode.com/problems/parallel-courses)|:lock:||Hard| +|1102|[check-if-a-number-is-majority-element-in-a-sorted-array](https://leetcode.com/problems/check-if-a-number-is-majority-element-in-a-sorted-array)|:lock:||Easy| +|1103|[moving-stones-until-consecutive](https://leetcode.com/problems/moving-stones-until-consecutive)|||Easy| +|1104|[coloring-a-border](https://leetcode.com/problems/coloring-a-border)|||Medium| +|1105|[uncrossed-lines](https://leetcode.com/problems/uncrossed-lines)|||Medium| +|1106|[escape-a-large-maze](https://leetcode.com/problems/escape-a-large-maze)|||Hard| +|1107|[minimum-swaps-to-group-all-1s-together](https://leetcode.com/problems/minimum-swaps-to-group-all-1s-together)|:lock:||Medium| +|1108|[analyze-user-website-visit-pattern](https://leetcode.com/problems/analyze-user-website-visit-pattern)|:lock:||Medium| +|1111|[minimum-score-triangulation-of-polygon](https://leetcode.com/problems/minimum-score-triangulation-of-polygon)|||Medium| +|1112|[find-words-that-can-be-formed-by-characters](https://leetcode.com/problems/find-words-that-can-be-formed-by-characters)|||Easy| +|1113|[moving-stones-until-consecutive-ii](https://leetcode.com/problems/moving-stones-until-consecutive-ii)|||Medium| +|1114|[binary-search-tree-to-greater-sum-tree](https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree)|||Medium| +|1115|[valid-boomerang](https://leetcode.com/problems/valid-boomerang)|||Easy| +|1116|[maximum-level-sum-of-a-binary-tree](https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree)|||Medium| +|1117|[as-far-from-land-as-possible](https://leetcode.com/problems/as-far-from-land-as-possible)|||Medium| +|1118|[divide-array-into-increasing-sequences](https://leetcode.com/problems/divide-array-into-increasing-sequences)|:lock:||Hard| +|1119|[robot-bounded-in-circle](https://leetcode.com/problems/robot-bounded-in-circle)|||Medium| +|1120|[flower-planting-with-no-adjacent](https://leetcode.com/problems/flower-planting-with-no-adjacent)|||Easy| +|1121|[partition-array-for-maximum-sum](https://leetcode.com/problems/partition-array-for-maximum-sum)|||Medium| +|1122|[longest-duplicate-substring](https://leetcode.com/problems/longest-duplicate-substring)||[:memo:](https://leetcode.com/articles/longest-duplicate-substring/)|Hard| +|1124|[string-transforms-into-another-string](https://leetcode.com/problems/string-transforms-into-another-string)|:lock:||Hard| +|1127|[last-stone-weight](https://leetcode.com/problems/last-stone-weight)|||Easy| +|1128|[remove-all-adjacent-duplicates-in-string](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string)||[:memo:](https://leetcode.com/articles/remove-all-adjacent-duplicates-in-string/)|Easy| +|1129|[longest-string-chain](https://leetcode.com/problems/longest-string-chain)|||Medium| +|1130|[last-stone-weight-ii](https://leetcode.com/problems/last-stone-weight-ii)|||Medium| +|1133|[last-substring-in-lexicographical-order](https://leetcode.com/problems/last-substring-in-lexicographical-order)|||Hard| +|1137|[height-checker](https://leetcode.com/problems/height-checker)|||Easy| +|1138|[grumpy-bookstore-owner](https://leetcode.com/problems/grumpy-bookstore-owner)|||Medium| +|1139|[previous-permutation-with-one-swap](https://leetcode.com/problems/previous-permutation-with-one-swap)|||Medium| +|1140|[distant-barcodes](https://leetcode.com/problems/distant-barcodes)|||Medium| +|1145|[number-of-submatrices-that-sum-to-target](https://leetcode.com/problems/number-of-submatrices-that-sum-to-target)|||Hard| +|1146|[greatest-common-divisor-of-strings](https://leetcode.com/problems/greatest-common-divisor-of-strings)|||Easy| +|1147|[flip-columns-for-maximum-number-of-equal-rows](https://leetcode.com/problems/flip-columns-for-maximum-number-of-equal-rows)|||Medium| +|1148|[adding-two-negabinary-numbers](https://leetcode.com/problems/adding-two-negabinary-numbers)|||Medium| +|1156|[occurrences-after-bigram](https://leetcode.com/problems/occurrences-after-bigram)|||Easy| +|1157|[insufficient-nodes-in-root-to-leaf-paths](https://leetcode.com/problems/insufficient-nodes-in-root-to-leaf-paths)|||Medium| +|1159|[smallest-subsequence-of-distinct-characters](https://leetcode.com/problems/smallest-subsequence-of-distinct-characters)|||Medium| +|1160|[letter-tile-possibilities](https://leetcode.com/problems/letter-tile-possibilities)|||Medium| +|1168|[duplicate-zeros](https://leetcode.com/problems/duplicate-zeros)|||Easy| +|1169|[largest-values-from-labels](https://leetcode.com/problems/largest-values-from-labels)|||Medium| +|1170|[shortest-common-supersequence](https://leetcode.com/problems/shortest-common-supersequence)|||Hard| +|1171|[shortest-path-in-binary-matrix](https://leetcode.com/problems/shortest-path-in-binary-matrix)|||Medium| +|1183|[statistics-from-a-large-sample](https://leetcode.com/problems/statistics-from-a-large-sample)|||Medium| +|1184|[car-pooling](https://leetcode.com/problems/car-pooling)|||Medium| +|1185|[find-in-mountain-array](https://leetcode.com/problems/find-in-mountain-array)|||Hard| +|1188|[brace-expansion-ii](https://leetcode.com/problems/brace-expansion-ii)|||Hard| +|1194|[path-in-zigzag-labelled-binary-tree](https://leetcode.com/problems/path-in-zigzag-labelled-binary-tree)|||Medium| +|1195|[distribute-candies-to-people](https://leetcode.com/problems/distribute-candies-to-people)||[:memo:](https://leetcode.com/articles/distribute-candies-to-people/)|Easy| +|1196|[filling-bookcase-shelves](https://leetcode.com/problems/filling-bookcase-shelves)|||Medium| +|1197|[parsing-a-boolean-expression](https://leetcode.com/problems/parsing-a-boolean-expression)|||Hard| +|1205|[defanging-an-ip-address](https://leetcode.com/problems/defanging-an-ip-address)|||Easy| +|1206|[corporate-flight-bookings](https://leetcode.com/problems/corporate-flight-bookings)|||Medium| +|1207|[delete-nodes-and-return-forest](https://leetcode.com/problems/delete-nodes-and-return-forest)|||Medium| +|1208|[maximum-nesting-depth-of-two-valid-parentheses-strings](https://leetcode.com/problems/maximum-nesting-depth-of-two-valid-parentheses-strings)|||Medium| +|1217|[relative-sort-array](https://leetcode.com/problems/relative-sort-array)|||Easy| +|1218|[lowest-common-ancestor-of-deepest-leaves](https://leetcode.com/problems/lowest-common-ancestor-of-deepest-leaves)|||Medium| +|1219|[longest-well-performing-interval](https://leetcode.com/problems/longest-well-performing-interval)|||Medium| +|1220|[smallest-sufficient-team](https://leetcode.com/problems/smallest-sufficient-team)|||Hard| +|1227|[number-of-equivalent-domino-pairs](https://leetcode.com/problems/number-of-equivalent-domino-pairs)|||Easy| +|1228|[minimum-cost-tree-from-leaf-values](https://leetcode.com/problems/minimum-cost-tree-from-leaf-values)|||Medium| +|1229|[shortest-path-with-alternating-colors](https://leetcode.com/problems/shortest-path-with-alternating-colors)|||Medium| +|1230|[maximum-of-absolute-value-expression](https://leetcode.com/problems/maximum-of-absolute-value-expression)|||Medium| +|1236|[n-th-tribonacci-number](https://leetcode.com/problems/n-th-tribonacci-number)||[:memo:](https://leetcode.com/articles/n-th-tribonacci-number/)|Easy| +|1238|[alphabet-board-path](https://leetcode.com/problems/alphabet-board-path)|||Medium| +|1239|[largest-1-bordered-square](https://leetcode.com/problems/largest-1-bordered-square)|||Medium| +|1240|[stone-game-ii](https://leetcode.com/problems/stone-game-ii)|||Medium| +|1247|[decrease-elements-to-make-array-zigzag](https://leetcode.com/problems/decrease-elements-to-make-array-zigzag)|||Medium| +|1248|[binary-tree-coloring-game](https://leetcode.com/problems/binary-tree-coloring-game)|||Medium| +|1249|[snapshot-array](https://leetcode.com/problems/snapshot-array)|||Medium| +|1250|[longest-common-subsequence](https://leetcode.com/problems/longest-common-subsequence)|||Medium| +|1251|[longest-chunked-palindrome-decomposition](https://leetcode.com/problems/longest-chunked-palindrome-decomposition)|||Hard| +|1260|[day-of-the-year](https://leetcode.com/problems/day-of-the-year)|||Easy| +|1261|[swap-for-longest-repeated-character-substring](https://leetcode.com/problems/swap-for-longest-repeated-character-substring)|||Medium| +|1262|[online-majority-element-in-subarray](https://leetcode.com/problems/online-majority-element-in-subarray)|||Hard| +|1263|[number-of-dice-rolls-with-target-sum](https://leetcode.com/problems/number-of-dice-rolls-with-target-sum)|||Medium| diff --git a/README_leetcode_generate.md b/README_leetcode_generate.md index 8464a910..46f76183 100644 --- a/README_leetcode_generate.md +++ b/README_leetcode_generate.md @@ -44,7 +44,7 @@ $ pipenv install Edit your own username, password, language and repo in the **config.cfg.example** file and then rename it to **config.cfg**. -driverpath - Please input the path of your chromedriver +driverpath - Set the path of chromedriver. For Windows users, please include **chromedriver.exe** in path. ``` [leetcode] diff --git a/solutions/0001-two-sum/two-sum.py b/solutions/0001-two-sum/two-sum.py index 3612fda9..99fe37f4 100644 --- a/solutions/0001-two-sum/two-sum.py +++ b/solutions/0001-two-sum/two-sum.py @@ -14,8 +14,6 @@ # return [0, 1]. # # -#   -# class Solution(object): diff --git a/solutions/0001-two-sum/two-sum.rs b/solutions/0001-two-sum/two-sum.rs index 46d51ffa..74a9b3c8 100644 --- a/solutions/0001-two-sum/two-sum.rs +++ b/solutions/0001-two-sum/two-sum.rs @@ -11,8 +11,6 @@ // return [0, 1]. // // -//   -// use std::collections::HashMap; diff --git a/solutions/0003-longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.py b/solutions/0003-longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.py index dc5e2621..0c80cf3c 100644 --- a/solutions/0003-longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.py +++ b/solutions/0003-longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.py @@ -33,6 +33,7 @@ # # # +# class Solution(object): diff --git a/solutions/0010-regular-expression-matching/regular-expression-matching.py b/solutions/0010-regular-expression-matching/regular-expression-matching.py index 718f1511..6b93bbc4 100644 --- a/solutions/0010-regular-expression-matching/regular-expression-matching.py +++ b/solutions/0010-regular-expression-matching/regular-expression-matching.py @@ -1,69 +1,69 @@ # -*- coding:utf-8 -*- -# Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. +# Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. # # -# '.' Matches any single character. -# '*' Matches zero or more of the preceding element. +# '.' Matches any single character. +# '*' Matches zero or more of the preceding element. # # -# The matching should cover the entire input string (not partial). +# The matching should cover the entire input string (not partial). # -# Note: +# Note: # # -# s could be empty and contains only lowercase letters a-z. -# p could be empty and contains only lowercase letters a-z, and characters like . or *. +# s could be empty and contains only lowercase letters a-z. +# p could be empty and contains only lowercase letters a-z, and characters like . or *. # # -# Example 1: +# Example 1: # # -# Input: -# s = "aa" -# p = "a" -# Output: false -# Explanation: "a" does not match the entire string "aa". +# Input: +# s = "aa" +# p = "a" +# Output: false +# Explanation: "a" does not match the entire string "aa". # # -# Example 2: +# Example 2: # # -# Input: -# s = "aa" -# p = "a*" -# Output: true -# Explanation: '*' means zero or more of the precedeng element, 'a'. Therefore, by repeating 'a' once, it becomes "aa". +# Input: +# s = "aa" +# p = "a*" +# Output: true +# Explanation: '*' means zero or more of the preceding element, 'a'. Therefore, by repeating 'a' once, it becomes "aa". # # -# Example 3: +# Example 3: # # -# Input: -# s = "ab" -# p = ".*" -# Output: true -# Explanation: ".*" means "zero or more (*) of any character (.)". +# Input: +# s = "ab" +# p = ".*" +# Output: true +# Explanation: ".*" means "zero or more (*) of any character (.)". # # -# Example 4: +# Example 4: # # -# Input: -# s = "aab" -# p = "c*a*b" -# Output: true -# Explanation: c can be repeated 0 times, a can be repeated 1 time. Therefore it matches "aab". +# Input: +# s = "aab" +# p = "c*a*b" +# Output: true +# Explanation: c can be repeated 0 times, a can be repeated 1 time. Therefore, it matches "aab". # # -# Example 5: +# Example 5: # # -# Input: -# s = "mississippi" -# p = "mis*is*p*." -# Output: false +# Input: +# s = "mississippi" +# p = "mis*is*p*." +# Output: false # # diff --git a/solutions/0056-merge-intervals/merge-intervals.py b/solutions/0056-merge-intervals/merge-intervals.py index dfcca39b..1090b8cc 100644 --- a/solutions/0056-merge-intervals/merge-intervals.py +++ b/solutions/0056-merge-intervals/merge-intervals.py @@ -18,6 +18,8 @@ # Output: [[1,5]] # Explanation: Intervals [1,4] and [4,5] are considered overlapping. # +# NOTE: input types have been changed on April 15, 2019. Please reset to default code definition to get new method signature. +# # Definition for an interval. diff --git a/solutions/0057-insert-interval/insert-interval.py b/solutions/0057-insert-interval/insert-interval.py index 939f959d..59ac15a4 100644 --- a/solutions/0057-insert-interval/insert-interval.py +++ b/solutions/0057-insert-interval/insert-interval.py @@ -19,6 +19,8 @@ # Output: [[1,2],[3,10],[12,16]] # Explanation: Because the new interval [4,8] overlaps with [3,5],[6,7],[8,10]. # +# NOTE: input types have been changed on April 15, 2019. Please reset to default code definition to get new method signature. +# # Definition for an interval. diff --git a/solutions/0058-length-of-last-word/length-of-last-word.py b/solutions/0058-length-of-last-word/length-of-last-word.py index 27b859ec..44d8d84c 100644 --- a/solutions/0058-length-of-last-word/length-of-last-word.py +++ b/solutions/0058-length-of-last-word/length-of-last-word.py @@ -9,10 +9,13 @@ # # Example: # +# # Input: "Hello World" # Output: 5 # # +#   +# class Solution(object): diff --git a/solutions/0101-symmetric-tree/symmetric-tree.py b/solutions/0101-symmetric-tree/symmetric-tree.py index 80c4d08c..cde0c4b3 100644 --- a/solutions/0101-symmetric-tree/symmetric-tree.py +++ b/solutions/0101-symmetric-tree/symmetric-tree.py @@ -3,9 +3,9 @@ # Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). # -# # For example, this binary tree [1,2,2,3,4,4,3] is symmetric: # +# # 1 # / \ # 2 2 @@ -13,8 +13,10 @@ # 3 4 4 3 # # +#   +# +# But the following [1,2,2,null,3,null,3] is not: # -# But the following [1,2,2,null,3,null,3] is not: # # 1 # / \ @@ -23,7 +25,7 @@ # 3 3 # # -# +#   # # Note: # Bonus points if you could solve it both recursively and iteratively. diff --git a/solutions/0141-linked-list-cycle/linked-list-cycle.py b/solutions/0141-linked-list-cycle/linked-list-cycle.py new file mode 100644 index 00000000..1aee033b --- /dev/null +++ b/solutions/0141-linked-list-cycle/linked-list-cycle.py @@ -0,0 +1,77 @@ +# -*- coding:utf-8 -*- + + +# Given a linked list, determine if it has a cycle in it. +# +# To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked list where tail connects to. If pos is -1, then there is no cycle in the linked list. +# +#   +# +# +# Example 1: +# +# +# Input: head = [3,2,0,-4], pos = 1 +# Output: true +# Explanation: There is a cycle in the linked list, where tail connects to the second node. +# +# +# +# +# +# +# Example 2: +# +# +# Input: head = [1,2], pos = 0 +# Output: true +# Explanation: There is a cycle in the linked list, where tail connects to the first node. +# +# +# +# +# +# +# Example 3: +# +# +# Input: head = [1], pos = -1 +# Output: false +# Explanation: There is no cycle in the linked list. +# +# +# +# +# +#   +# +# Follow up: +# +# Can you solve it using O(1) (i.e. constant) memory? +# + + +# Definition for singly-linked list. +# class ListNode(object): +# def __init__(self, x): +# self.val = x +# self.next = None + +class Solution(object): + def hasCycle(self, head): + """ + :type head: ListNode + :rtype: bool + """ + if head is None: + return False + cur = head + dct = {} + while cur.next: + if id(cur) in dct: + return True + dct[id(cur)] = cur + cur = cur.next + + return False + diff --git a/solutions/1065-binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n.py b/solutions/1065-binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n.py index 1cb201d3..09a95f28 100644 --- a/solutions/1065-binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n.py +++ b/solutions/1065-binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n.py @@ -27,6 +27,7 @@ # 1 <= S.length <= 1000 # 1 <= N <= 10^9 # +# class Solution(object):