Skip to content

Commit 9d422e6

Browse files
committed
Add Neetcode 250
1 parent 34802ee commit 9d422e6

File tree

5 files changed

+261
-2
lines changed

5 files changed

+261
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.3.4
4+
- Add Neetcode 250
5+
- Fix linting error
6+
37
## 1.3.3
48
- Fix issue in querying NeetCode videos
59
- Remove support for Python 3.7 (Cannot properly test for Mac)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ options:
3232
problem(s) for. (default: None)
3333
--file FILE, -f FILE The file containing the URL(s) or slug(s) of the LeetCode question(s)
3434
to generate problem(s) for. (default: None)
35-
--preset {blind_75,grind_75,grind_169,neetcode_150,neetcode_all}, -p {blind_75,grind_75,grind_169,neetcode_150,neetcode_all}
35+
--preset {blind_75,grind_75,grind_169,neetcode_150,neetcode_all}, -p {blind_75,grind_75,grind_169,neetcode_150,neetcode_250,neetcode_all}
3636
The preset to use to generate problem(s) for. (default: None)
3737
--format {anki,excel}, -F {anki,excel}
3838
The format to save the Leetcode problem(s) in. (default: anki)

leetcode_study_tool/outputs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def save_excel(problems: List[Union[List[Union[str, date]], None]], file: str) -
113113
for i, problem in enumerate(problems, start=1):
114114
if problem:
115115
for j, line in enumerate(problem):
116-
if type(line) == date and j == 3:
116+
if type(line) is date and j == 3:
117117
worksheet.write_datetime(i, j, line, date_format)
118118
else:
119119
worksheet.write(i, j, line)

leetcode_study_tool/presets.py

+254
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,259 @@
481481
"https://leetcode.com/problems/reverse-integer/",
482482
]
483483

484+
NEETCODE_250 = [
485+
"https://leetcode.com/problems/concatenation-of-array/",
486+
"https://leetcode.com/problems/contains-duplicate/",
487+
"https://leetcode.com/problems/valid-anagram/",
488+
"https://leetcode.com/problems/two-sum/",
489+
"https://leetcode.com/problems/longest-common-prefix/",
490+
"https://leetcode.com/problems/group-anagrams/",
491+
"https://leetcode.com/problems/remove-element/",
492+
"https://leetcode.com/problems/majority-element/",
493+
"https://leetcode.com/problems/design-hashset/",
494+
"https://leetcode.com/problems/design-hashmap/",
495+
"https://leetcode.com/problems/sort-an-array/",
496+
"https://leetcode.com/problems/sort-colors/",
497+
"https://leetcode.com/problems/top-k-frequent-elements/",
498+
"https://leetcode.com/problems/encode-and-decode-strings/",
499+
"https://leetcode.com/problems/range-sum-query-2d-immutable/",
500+
"https://leetcode.com/problems/product-of-array-except-self/",
501+
"https://leetcode.com/problems/valid-sudoku/",
502+
"https://leetcode.com/problems/longest-consecutive-sequence/",
503+
"https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/",
504+
"https://leetcode.com/problems/majority-element-ii",
505+
"https://leetcode.com/problems/subarray-sum-equals-k/",
506+
"https://leetcode.com/problems/first-missing-positive/",
507+
"https://leetcode.com/problems/reverse-string/",
508+
"https://leetcode.com/problems/valid-palindrome/",
509+
"https://leetcode.com/problems/valid-palindrome-ii/",
510+
"https://leetcode.com/problems/merge-strings-alternately/",
511+
"https://leetcode.com/problems/merge-sorted-array/",
512+
"https://leetcode.com/problems/remove-duplicates-from-sorted-array/",
513+
"https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/",
514+
"https://leetcode.com/problems/3sum/",
515+
"https://leetcode.com/problems/4sum/",
516+
"https://leetcode.com/problems/rotate-array/",
517+
"https://leetcode.com/problems/container-with-most-water/",
518+
"https://leetcode.com/problems/boats-to-save-people/",
519+
"https://leetcode.com/problems/trapping-rain-water/",
520+
"https://leetcode.com/problems/contains-duplicate-ii/",
521+
"https://leetcode.com/problems/best-time-to-buy-and-sell-stock/",
522+
"https://leetcode.com/problems/longest-substring-without-repeating-characters/",
523+
"https://leetcode.com/problems/longest-repeating-character-replacement/",
524+
"https://leetcode.com/problems/permutation-in-string/",
525+
"https://leetcode.com/problems/minimum-size-subarray-sum/",
526+
"https://leetcode.com/problems/find-k-closest-elements/",
527+
"https://leetcode.com/problems/minimum-window-substring/",
528+
"https://leetcode.com/problems/sliding-window-maximum/",
529+
"https://leetcode.com/problems/baseball-game/",
530+
"https://leetcode.com/problems/valid-parentheses/",
531+
"https://leetcode.com/problems/implement-stack-using-queues/",
532+
"https://leetcode.com/problems/implement-queue-using-stacks",
533+
"https://leetcode.com/problems/min-stack/",
534+
"https://leetcode.com/problems/evaluate-reverse-polish-notation/",
535+
"https://leetcode.com/problems/generate-parentheses/",
536+
"https://leetcode.com/problems/asteroid-collision/",
537+
"https://leetcode.com/problems/daily-temperatures/",
538+
"https://leetcode.com/problems/online-stock-span/",
539+
"https://leetcode.com/problems/car-fleet/",
540+
"https://leetcode.com/problems/simplify-path/",
541+
"https://leetcode.com/problems/decode-string/",
542+
"https://leetcode.com/problems/maximum-frequency-stack/",
543+
"https://leetcode.com/problems/largest-rectangle-in-histogram/",
544+
"https://leetcode.com/problems/binary-search/",
545+
"https://leetcode.com/problems/search-insert-position/",
546+
"https://leetcode.com/problems/guess-number-higher-or-lower/",
547+
"https://leetcode.com/problems/sqrtx/",
548+
"https://leetcode.com/problems/search-a-2d-matrix/",
549+
"https://leetcode.com/problems/koko-eating-bananas/",
550+
"https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/",
551+
"https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/",
552+
"https://leetcode.com/problems/search-in-rotated-sorted-array/",
553+
"https://leetcode.com/problems/search-in-rotated-sorted-array-ii/",
554+
"https://leetcode.com/problems/time-based-key-value-store/",
555+
"https://leetcode.com/problems/split-array-largest-sum/",
556+
"https://leetcode.com/problems/median-of-two-sorted-arrays/",
557+
"https://leetcode.com/problems/find-in-mountain-array",
558+
"https://leetcode.com/problems/reverse-linked-list/",
559+
"https://leetcode.com/problems/merge-two-sorted-lists/",
560+
"https://leetcode.com/problems/linked-list-cycle/",
561+
"https://leetcode.com/problems/reorder-list/",
562+
"https://leetcode.com/problems/remove-nth-node-from-end-of-list/",
563+
"https://leetcode.com/problems/copy-list-with-random-pointer/",
564+
"https://leetcode.com/problems/add-two-numbers/",
565+
"https://leetcode.com/problems/find-the-duplicate-number/",
566+
"https://leetcode.com/problems/reverse-linked-list-ii/",
567+
"https://leetcode.com/problems/design-circular-queue/",
568+
"https://leetcode.com/problems/lru-cache/",
569+
"https://leetcode.com/problems/lfu-cache/",
570+
"https://leetcode.com/problems/merge-k-sorted-lists/",
571+
"https://leetcode.com/problems/reverse-nodes-in-k-group/",
572+
"https://leetcode.com/problems/binary-tree-inorder-traversal/",
573+
"https://leetcode.com/problems/binary-tree-preorder-traversal/",
574+
"https://leetcode.com/problems/binary-tree-postorder-traversal/",
575+
"https://leetcode.com/problems/invert-binary-tree/",
576+
"https://leetcode.com/problems/maximum-depth-of-binary-tree/",
577+
"https://leetcode.com/problems/diameter-of-binary-tree/",
578+
"https://leetcode.com/problems/balanced-binary-tree/",
579+
"https://leetcode.com/problems/same-tree/",
580+
"https://leetcode.com/problems/subtree-of-another-tree/",
581+
"https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/",
582+
"https://leetcode.com/problems/insert-into-a-binary-search-tree/",
583+
"https://leetcode.com/problems/delete-node-in-a-bst/",
584+
"https://leetcode.com/problems/binary-tree-level-order-traversal/",
585+
"https://leetcode.com/problems/binary-tree-right-side-view/",
586+
"https://leetcode.com/problems/construct-quad-tree/",
587+
"https://leetcode.com/problems/count-good-nodes-in-binary-tree/",
588+
"https://leetcode.com/problems/validate-binary-search-tree/",
589+
"https://leetcode.com/problems/kth-smallest-element-in-a-bst/",
590+
"https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/",
591+
"https://leetcode.com/problems/house-robber-iii/",
592+
"https://leetcode.com/problems/delete-leaves-with-a-given-value",
593+
"https://leetcode.com/problems/binary-tree-maximum-path-sum/",
594+
"https://leetcode.com/problems/serialize-and-deserialize-binary-tree/",
595+
"https://leetcode.com/problems/kth-largest-element-in-a-stream/",
596+
"https://leetcode.com/problems/last-stone-weight/",
597+
"https://leetcode.com/problems/k-closest-points-to-origin/",
598+
"https://leetcode.com/problems/kth-largest-element-in-an-array/",
599+
"https://leetcode.com/problems/task-scheduler/",
600+
"https://leetcode.com/problems/design-twitter/",
601+
"https://leetcode.com/problems/single-threaded-cpu/",
602+
"https://leetcode.com/problems/reorganize-string/",
603+
"https://leetcode.com/problems/longest-happy-string/",
604+
"https://leetcode.com/problems/car-pooling/",
605+
"https://leetcode.com/problems/find-median-from-data-stream/",
606+
"https://leetcode.com/problems/ipo/",
607+
"https://leetcode.com/problems/sum-of-all-subset-xor-totals",
608+
"https://leetcode.com/problems/subsets/",
609+
"https://leetcode.com/problems/combination-sum/",
610+
"https://leetcode.com/problems/combination-sum-ii/",
611+
"https://leetcode.com/problems/combinations/",
612+
"https://leetcode.com/problems/permutations/",
613+
"https://leetcode.com/problems/subsets-ii/",
614+
"https://leetcode.com/problems/permutations-ii/",
615+
"https://leetcode.com/problems/word-search/",
616+
"https://leetcode.com/problems/palindrome-partitioning/",
617+
"https://leetcode.com/problems/letter-combinations-of-a-phone-number/",
618+
"https://leetcode.com/problems/matchsticks-to-square/",
619+
"https://leetcode.com/problems/partition-to-k-equal-sum-subsets/",
620+
"https://leetcode.com/problems/n-queens/",
621+
"https://leetcode.com/problems/n-queens-ii/",
622+
"https://leetcode.com/problems/word-break-ii",
623+
"https://leetcode.com/problems/implement-trie-prefix-tree/",
624+
"https://leetcode.com/problems/design-add-and-search-words-data-structure/",
625+
"https://leetcode.com/problems/extra-characters-in-a-string/",
626+
"https://leetcode.com/problems/word-search-ii/",
627+
"https://leetcode.com/problems/island-perimeter/",
628+
"https://leetcode.com/problems/verifying-an-alien-dictionary/",
629+
"https://leetcode.com/problems/find-the-town-judge",
630+
"https://leetcode.com/problems/number-of-islands/",
631+
"https://leetcode.com/problems/max-area-of-island/",
632+
"https://leetcode.com/problems/clone-graph/",
633+
"https://leetcode.com/problems/walls-and-gates/",
634+
"https://leetcode.com/problems/rotting-oranges/",
635+
"https://leetcode.com/problems/pacific-atlantic-water-flow/",
636+
"https://leetcode.com/problems/surrounded-regions/",
637+
"https://leetcode.com/problems/open-the-lock/",
638+
"https://leetcode.com/problems/course-schedule/",
639+
"https://leetcode.com/problems/course-schedule-ii/",
640+
"https://leetcode.com/problems/graph-valid-tree/",
641+
"https://leetcode.com/problems/course-schedule-iv/",
642+
"https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/",
643+
"https://leetcode.com/problems/redundant-connection/",
644+
"https://leetcode.com/problems/accounts-merge/",
645+
"https://leetcode.com/problems/evaluate-division/",
646+
"https://leetcode.com/problems/minimum-height-trees",
647+
"https://leetcode.com/problems/word-ladder/",
648+
"https://leetcode.com/problems/path-with-minimum-effort/",
649+
"https://leetcode.com/problems/network-delay-time/",
650+
"https://leetcode.com/problems/reconstruct-itinerary/",
651+
"https://leetcode.com/problems/min-cost-to-connect-all-points/",
652+
"https://leetcode.com/problems/swim-in-rising-water/",
653+
"https://leetcode.com/problems/alien-dictionary/",
654+
"https://leetcode.com/problems/cheapest-flights-within-k-stops/",
655+
"https://leetcode.com/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/",
656+
"https://leetcode.com/problems/build-a-matrix-with-conditions",
657+
"https://leetcode.com/problems/greatest-common-divisor-traversal",
658+
"https://leetcode.com/problems/climbing-stairs/",
659+
"https://leetcode.com/problems/min-cost-climbing-stairs/",
660+
"https://leetcode.com/problems/n-th-tribonacci-number/",
661+
"https://leetcode.com/problems/house-robber/",
662+
"https://leetcode.com/problems/house-robber-ii/",
663+
"https://leetcode.com/problems/longest-palindromic-substring/",
664+
"https://leetcode.com/problems/palindromic-substrings/",
665+
"https://leetcode.com/problems/decode-ways/",
666+
"https://leetcode.com/problems/coin-change/",
667+
"https://leetcode.com/problems/maximum-product-subarray/",
668+
"https://leetcode.com/problems/word-break/",
669+
"https://leetcode.com/problems/longest-increasing-subsequence/",
670+
"https://leetcode.com/problems/partition-equal-subset-sum/",
671+
"https://leetcode.com/problems/combination-sum-iv/",
672+
"https://leetcode.com/problems/perfect-squares/",
673+
"https://leetcode.com/problems/integer-break/",
674+
"https://leetcode.com/problems/stone-game-iii/",
675+
"https://leetcode.com/problems/unique-paths/",
676+
"https://leetcode.com/problems/unique-paths-ii/",
677+
"https://leetcode.com/problems/minimum-path-sum/",
678+
"https://leetcode.com/problems/longest-common-subsequence/",
679+
"https://leetcode.com/problems/last-stone-weight-ii/",
680+
"https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/",
681+
"https://leetcode.com/problems/coin-change-ii/",
682+
"https://leetcode.com/problems/target-sum/",
683+
"https://leetcode.com/problems/interleaving-string/",
684+
"https://leetcode.com/problems/stone-game/",
685+
"https://leetcode.com/problems/stone-game-ii/",
686+
"https://leetcode.com/problems/longest-increasing-path-in-a-matrix/",
687+
"https://leetcode.com/problems/distinct-subsequences/",
688+
"https://leetcode.com/problems/edit-distance/",
689+
"https://leetcode.com/problems/burst-balloons/",
690+
"https://leetcode.com/problems/regular-expression-matching/",
691+
"https://leetcode.com/problems/lemonade-change/",
692+
"https://leetcode.com/problems/maximum-subarray/",
693+
"https://leetcode.com/problems/maximum-sum-circular-subarray/",
694+
"https://leetcode.com/problems/longest-turbulent-subarray/",
695+
"https://leetcode.com/problems/jump-game/",
696+
"https://leetcode.com/problems/jump-game-ii/",
697+
"https://leetcode.com/problems/jump-game-vii/",
698+
"https://leetcode.com/problems/gas-station/",
699+
"https://leetcode.com/problems/hand-of-straights/",
700+
"https://leetcode.com/problems/dota2-senate/",
701+
"https://leetcode.com/problems/merge-triplets-to-form-target-triplet/",
702+
"https://leetcode.com/problems/partition-labels/",
703+
"https://leetcode.com/problems/valid-parenthesis-string/",
704+
"https://leetcode.com/problems/candy/",
705+
"https://leetcode.com/problems/insert-interval/",
706+
"https://leetcode.com/problems/merge-intervals/",
707+
"https://leetcode.com/problems/non-overlapping-intervals/",
708+
"https://leetcode.com/problems/meeting-rooms/",
709+
"https://leetcode.com/problems/meeting-rooms-ii/",
710+
"https://leetcode.com/problems/meeting-rooms-iii",
711+
"https://leetcode.com/problems/minimum-interval-to-include-each-query/",
712+
"https://leetcode.com/problems/excel-sheet-column-title/",
713+
"https://leetcode.com/problems/greatest-common-divisor-of-strings/",
714+
"https://leetcode.com/problems/insert-greatest-common-divisors-in-linked-list/",
715+
"https://leetcode.com/problems/transpose-matrix",
716+
"https://leetcode.com/problems/rotate-image/",
717+
"https://leetcode.com/problems/spiral-matrix/",
718+
"https://leetcode.com/problems/set-matrix-zeroes/",
719+
"https://leetcode.com/problems/happy-number/",
720+
"https://leetcode.com/problems/plus-one/",
721+
"https://leetcode.com/problems/roman-to-integer/",
722+
"https://leetcode.com/problems/powx-n/",
723+
"https://leetcode.com/problems/multiply-strings/",
724+
"https://leetcode.com/problems/detect-squares/",
725+
"https://leetcode.com/problems/single-number/",
726+
"https://leetcode.com/problems/number-of-1-bits/",
727+
"https://leetcode.com/problems/counting-bits/",
728+
"https://leetcode.com/problems/add-binary/",
729+
"https://leetcode.com/problems/reverse-bits/",
730+
"https://leetcode.com/problems/missing-number/",
731+
"https://leetcode.com/problems/sum-of-two-integers/",
732+
"https://leetcode.com/problems/reverse-integer/",
733+
"https://leetcode.com/problems/bitwise-and-of-numbers-range",
734+
"https://leetcode.com/problems/minimum-array-end/",
735+
]
736+
484737
NEETCODE_ALL = [
485738
"https://leetcode.com/problems/contains-duplicate/",
486739
"https://leetcode.com/problems/valid-anagram/",
@@ -928,5 +1181,6 @@
9281181
"grind_75": GRIND_75,
9291182
"grind_169": GRIND_169,
9301183
"neetcode_150": NEETCODE_150,
1184+
"neetcode_250": NEETCODE_250,
9311185
"neetcode_all": NEETCODE_ALL,
9321186
}

scripts/presets.py

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def main(args: argparse.Namespace):
3838
):
3939
problems.append(url.geturl().decode())
4040

41+
print("Found {} problems".format(len(problems)))
4142
with open(args.output, "a") as f:
4243
json.dump(problems, f)
4344

0 commit comments

Comments
 (0)