diff --git a/CHANGELOG.md b/CHANGELOG.md index b41fd7c..bc8bbba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.3.4 +- Add Neetcode 250 +- Fix linting error + ## 1.3.3 - Fix issue in querying NeetCode videos - Remove support for Python 3.7 (Cannot properly test for Mac) diff --git a/README.md b/README.md index 3f69eaf..e1a2e79 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ options: problem(s) for. (default: None) --file FILE, -f FILE The file containing the URL(s) or slug(s) of the LeetCode question(s) to generate problem(s) for. (default: None) - --preset {blind_75,grind_75,grind_169,neetcode_150,neetcode_all}, -p {blind_75,grind_75,grind_169,neetcode_150,neetcode_all} + --preset {blind_75,grind_75,grind_169,neetcode_150,neetcode_all}, -p {blind_75,grind_75,grind_169,neetcode_150,neetcode_250,neetcode_all} The preset to use to generate problem(s) for. (default: None) --format {anki,excel}, -F {anki,excel} The format to save the Leetcode problem(s) in. (default: anki) diff --git a/leetcode_study_tool/outputs.py b/leetcode_study_tool/outputs.py index a7d7cfa..cff38b0 100644 --- a/leetcode_study_tool/outputs.py +++ b/leetcode_study_tool/outputs.py @@ -113,7 +113,7 @@ def save_excel(problems: List[Union[List[Union[str, date]], None]], file: str) - for i, problem in enumerate(problems, start=1): if problem: for j, line in enumerate(problem): - if type(line) == date and j == 3: + if type(line) is date and j == 3: worksheet.write_datetime(i, j, line, date_format) else: worksheet.write(i, j, line) diff --git a/leetcode_study_tool/presets.py b/leetcode_study_tool/presets.py index 28b768d..a85c7e4 100644 --- a/leetcode_study_tool/presets.py +++ b/leetcode_study_tool/presets.py @@ -481,6 +481,259 @@ "https://leetcode.com/problems/reverse-integer/", ] +NEETCODE_250 = [ + "https://leetcode.com/problems/concatenation-of-array/", + "https://leetcode.com/problems/contains-duplicate/", + "https://leetcode.com/problems/valid-anagram/", + "https://leetcode.com/problems/two-sum/", + "https://leetcode.com/problems/longest-common-prefix/", + "https://leetcode.com/problems/group-anagrams/", + "https://leetcode.com/problems/remove-element/", + "https://leetcode.com/problems/majority-element/", + "https://leetcode.com/problems/design-hashset/", + "https://leetcode.com/problems/design-hashmap/", + "https://leetcode.com/problems/sort-an-array/", + "https://leetcode.com/problems/sort-colors/", + "https://leetcode.com/problems/top-k-frequent-elements/", + "https://leetcode.com/problems/encode-and-decode-strings/", + "https://leetcode.com/problems/range-sum-query-2d-immutable/", + "https://leetcode.com/problems/product-of-array-except-self/", + "https://leetcode.com/problems/valid-sudoku/", + "https://leetcode.com/problems/longest-consecutive-sequence/", + "https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/", + "https://leetcode.com/problems/majority-element-ii", + "https://leetcode.com/problems/subarray-sum-equals-k/", + "https://leetcode.com/problems/first-missing-positive/", + "https://leetcode.com/problems/reverse-string/", + "https://leetcode.com/problems/valid-palindrome/", + "https://leetcode.com/problems/valid-palindrome-ii/", + "https://leetcode.com/problems/merge-strings-alternately/", + "https://leetcode.com/problems/merge-sorted-array/", + "https://leetcode.com/problems/remove-duplicates-from-sorted-array/", + "https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/", + "https://leetcode.com/problems/3sum/", + "https://leetcode.com/problems/4sum/", + "https://leetcode.com/problems/rotate-array/", + "https://leetcode.com/problems/container-with-most-water/", + "https://leetcode.com/problems/boats-to-save-people/", + "https://leetcode.com/problems/trapping-rain-water/", + "https://leetcode.com/problems/contains-duplicate-ii/", + "https://leetcode.com/problems/best-time-to-buy-and-sell-stock/", + "https://leetcode.com/problems/longest-substring-without-repeating-characters/", + "https://leetcode.com/problems/longest-repeating-character-replacement/", + "https://leetcode.com/problems/permutation-in-string/", + "https://leetcode.com/problems/minimum-size-subarray-sum/", + "https://leetcode.com/problems/find-k-closest-elements/", + "https://leetcode.com/problems/minimum-window-substring/", + "https://leetcode.com/problems/sliding-window-maximum/", + "https://leetcode.com/problems/baseball-game/", + "https://leetcode.com/problems/valid-parentheses/", + "https://leetcode.com/problems/implement-stack-using-queues/", + "https://leetcode.com/problems/implement-queue-using-stacks", + "https://leetcode.com/problems/min-stack/", + "https://leetcode.com/problems/evaluate-reverse-polish-notation/", + "https://leetcode.com/problems/generate-parentheses/", + "https://leetcode.com/problems/asteroid-collision/", + "https://leetcode.com/problems/daily-temperatures/", + "https://leetcode.com/problems/online-stock-span/", + "https://leetcode.com/problems/car-fleet/", + "https://leetcode.com/problems/simplify-path/", + "https://leetcode.com/problems/decode-string/", + "https://leetcode.com/problems/maximum-frequency-stack/", + "https://leetcode.com/problems/largest-rectangle-in-histogram/", + "https://leetcode.com/problems/binary-search/", + "https://leetcode.com/problems/search-insert-position/", + "https://leetcode.com/problems/guess-number-higher-or-lower/", + "https://leetcode.com/problems/sqrtx/", + "https://leetcode.com/problems/search-a-2d-matrix/", + "https://leetcode.com/problems/koko-eating-bananas/", + "https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/", + "https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/", + "https://leetcode.com/problems/search-in-rotated-sorted-array/", + "https://leetcode.com/problems/search-in-rotated-sorted-array-ii/", + "https://leetcode.com/problems/time-based-key-value-store/", + "https://leetcode.com/problems/split-array-largest-sum/", + "https://leetcode.com/problems/median-of-two-sorted-arrays/", + "https://leetcode.com/problems/find-in-mountain-array", + "https://leetcode.com/problems/reverse-linked-list/", + "https://leetcode.com/problems/merge-two-sorted-lists/", + "https://leetcode.com/problems/linked-list-cycle/", + "https://leetcode.com/problems/reorder-list/", + "https://leetcode.com/problems/remove-nth-node-from-end-of-list/", + "https://leetcode.com/problems/copy-list-with-random-pointer/", + "https://leetcode.com/problems/add-two-numbers/", + "https://leetcode.com/problems/find-the-duplicate-number/", + "https://leetcode.com/problems/reverse-linked-list-ii/", + "https://leetcode.com/problems/design-circular-queue/", + "https://leetcode.com/problems/lru-cache/", + "https://leetcode.com/problems/lfu-cache/", + "https://leetcode.com/problems/merge-k-sorted-lists/", + "https://leetcode.com/problems/reverse-nodes-in-k-group/", + "https://leetcode.com/problems/binary-tree-inorder-traversal/", + "https://leetcode.com/problems/binary-tree-preorder-traversal/", + "https://leetcode.com/problems/binary-tree-postorder-traversal/", + "https://leetcode.com/problems/invert-binary-tree/", + "https://leetcode.com/problems/maximum-depth-of-binary-tree/", + "https://leetcode.com/problems/diameter-of-binary-tree/", + "https://leetcode.com/problems/balanced-binary-tree/", + "https://leetcode.com/problems/same-tree/", + "https://leetcode.com/problems/subtree-of-another-tree/", + "https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/", + "https://leetcode.com/problems/insert-into-a-binary-search-tree/", + "https://leetcode.com/problems/delete-node-in-a-bst/", + "https://leetcode.com/problems/binary-tree-level-order-traversal/", + "https://leetcode.com/problems/binary-tree-right-side-view/", + "https://leetcode.com/problems/construct-quad-tree/", + "https://leetcode.com/problems/count-good-nodes-in-binary-tree/", + "https://leetcode.com/problems/validate-binary-search-tree/", + "https://leetcode.com/problems/kth-smallest-element-in-a-bst/", + "https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/", + "https://leetcode.com/problems/house-robber-iii/", + "https://leetcode.com/problems/delete-leaves-with-a-given-value", + "https://leetcode.com/problems/binary-tree-maximum-path-sum/", + "https://leetcode.com/problems/serialize-and-deserialize-binary-tree/", + "https://leetcode.com/problems/kth-largest-element-in-a-stream/", + "https://leetcode.com/problems/last-stone-weight/", + "https://leetcode.com/problems/k-closest-points-to-origin/", + "https://leetcode.com/problems/kth-largest-element-in-an-array/", + "https://leetcode.com/problems/task-scheduler/", + "https://leetcode.com/problems/design-twitter/", + "https://leetcode.com/problems/single-threaded-cpu/", + "https://leetcode.com/problems/reorganize-string/", + "https://leetcode.com/problems/longest-happy-string/", + "https://leetcode.com/problems/car-pooling/", + "https://leetcode.com/problems/find-median-from-data-stream/", + "https://leetcode.com/problems/ipo/", + "https://leetcode.com/problems/sum-of-all-subset-xor-totals", + "https://leetcode.com/problems/subsets/", + "https://leetcode.com/problems/combination-sum/", + "https://leetcode.com/problems/combination-sum-ii/", + "https://leetcode.com/problems/combinations/", + "https://leetcode.com/problems/permutations/", + "https://leetcode.com/problems/subsets-ii/", + "https://leetcode.com/problems/permutations-ii/", + "https://leetcode.com/problems/word-search/", + "https://leetcode.com/problems/palindrome-partitioning/", + "https://leetcode.com/problems/letter-combinations-of-a-phone-number/", + "https://leetcode.com/problems/matchsticks-to-square/", + "https://leetcode.com/problems/partition-to-k-equal-sum-subsets/", + "https://leetcode.com/problems/n-queens/", + "https://leetcode.com/problems/n-queens-ii/", + "https://leetcode.com/problems/word-break-ii", + "https://leetcode.com/problems/implement-trie-prefix-tree/", + "https://leetcode.com/problems/design-add-and-search-words-data-structure/", + "https://leetcode.com/problems/extra-characters-in-a-string/", + "https://leetcode.com/problems/word-search-ii/", + "https://leetcode.com/problems/island-perimeter/", + "https://leetcode.com/problems/verifying-an-alien-dictionary/", + "https://leetcode.com/problems/find-the-town-judge", + "https://leetcode.com/problems/number-of-islands/", + "https://leetcode.com/problems/max-area-of-island/", + "https://leetcode.com/problems/clone-graph/", + "https://leetcode.com/problems/walls-and-gates/", + "https://leetcode.com/problems/rotting-oranges/", + "https://leetcode.com/problems/pacific-atlantic-water-flow/", + "https://leetcode.com/problems/surrounded-regions/", + "https://leetcode.com/problems/open-the-lock/", + "https://leetcode.com/problems/course-schedule/", + "https://leetcode.com/problems/course-schedule-ii/", + "https://leetcode.com/problems/graph-valid-tree/", + "https://leetcode.com/problems/course-schedule-iv/", + "https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/", + "https://leetcode.com/problems/redundant-connection/", + "https://leetcode.com/problems/accounts-merge/", + "https://leetcode.com/problems/evaluate-division/", + "https://leetcode.com/problems/minimum-height-trees", + "https://leetcode.com/problems/word-ladder/", + "https://leetcode.com/problems/path-with-minimum-effort/", + "https://leetcode.com/problems/network-delay-time/", + "https://leetcode.com/problems/reconstruct-itinerary/", + "https://leetcode.com/problems/min-cost-to-connect-all-points/", + "https://leetcode.com/problems/swim-in-rising-water/", + "https://leetcode.com/problems/alien-dictionary/", + "https://leetcode.com/problems/cheapest-flights-within-k-stops/", + "https://leetcode.com/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/", + "https://leetcode.com/problems/build-a-matrix-with-conditions", + "https://leetcode.com/problems/greatest-common-divisor-traversal", + "https://leetcode.com/problems/climbing-stairs/", + "https://leetcode.com/problems/min-cost-climbing-stairs/", + "https://leetcode.com/problems/n-th-tribonacci-number/", + "https://leetcode.com/problems/house-robber/", + "https://leetcode.com/problems/house-robber-ii/", + "https://leetcode.com/problems/longest-palindromic-substring/", + "https://leetcode.com/problems/palindromic-substrings/", + "https://leetcode.com/problems/decode-ways/", + "https://leetcode.com/problems/coin-change/", + "https://leetcode.com/problems/maximum-product-subarray/", + "https://leetcode.com/problems/word-break/", + "https://leetcode.com/problems/longest-increasing-subsequence/", + "https://leetcode.com/problems/partition-equal-subset-sum/", + "https://leetcode.com/problems/combination-sum-iv/", + "https://leetcode.com/problems/perfect-squares/", + "https://leetcode.com/problems/integer-break/", + "https://leetcode.com/problems/stone-game-iii/", + "https://leetcode.com/problems/unique-paths/", + "https://leetcode.com/problems/unique-paths-ii/", + "https://leetcode.com/problems/minimum-path-sum/", + "https://leetcode.com/problems/longest-common-subsequence/", + "https://leetcode.com/problems/last-stone-weight-ii/", + "https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/", + "https://leetcode.com/problems/coin-change-ii/", + "https://leetcode.com/problems/target-sum/", + "https://leetcode.com/problems/interleaving-string/", + "https://leetcode.com/problems/stone-game/", + "https://leetcode.com/problems/stone-game-ii/", + "https://leetcode.com/problems/longest-increasing-path-in-a-matrix/", + "https://leetcode.com/problems/distinct-subsequences/", + "https://leetcode.com/problems/edit-distance/", + "https://leetcode.com/problems/burst-balloons/", + "https://leetcode.com/problems/regular-expression-matching/", + "https://leetcode.com/problems/lemonade-change/", + "https://leetcode.com/problems/maximum-subarray/", + "https://leetcode.com/problems/maximum-sum-circular-subarray/", + "https://leetcode.com/problems/longest-turbulent-subarray/", + "https://leetcode.com/problems/jump-game/", + "https://leetcode.com/problems/jump-game-ii/", + "https://leetcode.com/problems/jump-game-vii/", + "https://leetcode.com/problems/gas-station/", + "https://leetcode.com/problems/hand-of-straights/", + "https://leetcode.com/problems/dota2-senate/", + "https://leetcode.com/problems/merge-triplets-to-form-target-triplet/", + "https://leetcode.com/problems/partition-labels/", + "https://leetcode.com/problems/valid-parenthesis-string/", + "https://leetcode.com/problems/candy/", + "https://leetcode.com/problems/insert-interval/", + "https://leetcode.com/problems/merge-intervals/", + "https://leetcode.com/problems/non-overlapping-intervals/", + "https://leetcode.com/problems/meeting-rooms/", + "https://leetcode.com/problems/meeting-rooms-ii/", + "https://leetcode.com/problems/meeting-rooms-iii", + "https://leetcode.com/problems/minimum-interval-to-include-each-query/", + "https://leetcode.com/problems/excel-sheet-column-title/", + "https://leetcode.com/problems/greatest-common-divisor-of-strings/", + "https://leetcode.com/problems/insert-greatest-common-divisors-in-linked-list/", + "https://leetcode.com/problems/transpose-matrix", + "https://leetcode.com/problems/rotate-image/", + "https://leetcode.com/problems/spiral-matrix/", + "https://leetcode.com/problems/set-matrix-zeroes/", + "https://leetcode.com/problems/happy-number/", + "https://leetcode.com/problems/plus-one/", + "https://leetcode.com/problems/roman-to-integer/", + "https://leetcode.com/problems/powx-n/", + "https://leetcode.com/problems/multiply-strings/", + "https://leetcode.com/problems/detect-squares/", + "https://leetcode.com/problems/single-number/", + "https://leetcode.com/problems/number-of-1-bits/", + "https://leetcode.com/problems/counting-bits/", + "https://leetcode.com/problems/add-binary/", + "https://leetcode.com/problems/reverse-bits/", + "https://leetcode.com/problems/missing-number/", + "https://leetcode.com/problems/sum-of-two-integers/", + "https://leetcode.com/problems/reverse-integer/", + "https://leetcode.com/problems/bitwise-and-of-numbers-range", + "https://leetcode.com/problems/minimum-array-end/", +] + NEETCODE_ALL = [ "https://leetcode.com/problems/contains-duplicate/", "https://leetcode.com/problems/valid-anagram/", @@ -928,5 +1181,6 @@ "grind_75": GRIND_75, "grind_169": GRIND_169, "neetcode_150": NEETCODE_150, + "neetcode_250": NEETCODE_250, "neetcode_all": NEETCODE_ALL, } diff --git a/scripts/presets.py b/scripts/presets.py index ca8fd2a..c6472c8 100644 --- a/scripts/presets.py +++ b/scripts/presets.py @@ -38,6 +38,7 @@ def main(args: argparse.Namespace): ): problems.append(url.geturl().decode()) + print("Found {} problems".format(len(problems))) with open(args.output, "a") as f: json.dump(problems, f)