Skip to content

Sosuke23/LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A collection of LeetCode questions to ace the coding interview! - Created using LeetHub v2

LeetCode Topics

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0011-container-with-most-water
0026-remove-duplicates-from-sorted-array
0027-remove-element
0042-trapping-rain-water
0045-jump-game-ii
0049-group-anagrams
0055-jump-game
0073-set-matrix-zeroes
0075-sort-colors
0080-remove-duplicates-from-sorted-array-ii
0088-merge-sorted-array
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0134-gas-station
0135-candy
0149-max-points-on-a-line
0167-two-sum-ii-input-array-is-sorted
0169-majority-element
0189-rotate-array
0200-number-of-islands
0219-contains-duplicate-ii
0220-contains-duplicate-iii
0238-product-of-array-except-self
0239-sliding-window-maximum
0260-single-number-iii
0407-trapping-rain-water-ii
0452-minimum-number-of-arrows-to-burst-balloons
0502-ipo
0560-subarray-sum-equals-k
0632-smallest-range-covering-elements-from-k-lists
0689-maximum-sum-of-3-non-overlapping-subarrays
0714-best-time-to-buy-and-sell-stock-with-transaction-fee
0731-my-calendar-ii
0780-max-chunks-to-make-sorted
0787-sliding-puzzle
0802-k-th-smallest-prime-fraction
0892-shortest-subarray-with-sum-at-least-k
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0945-snakes-and-ladders
0952-word-subsets
1002-maximum-width-ramp
1025-minimum-cost-for-tickets
1049-minimum-domino-rotations-for-equal-row
1063-best-sightseeing-pair
1147-flip-columns-for-maximum-number-of-equal-rows
1184-car-pooling
1227-number-of-equivalent-domino-pairs
1335-maximum-candies-allocated-to-k-children
1350-remove-sub-folders-from-the-filesystem
1364-tuple-with-same-product
1370-count-number-of-nice-subarrays
1396-count-servers-that-communicate
1402-count-square-submatrices-with-all-ones
1424-maximum-candies-you-can-get-from-boxes
1445-number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold
1468-check-if-n-and-its-double-exist
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1511-count-number-of-teams
1524-string-matching-in-an-array
1570-final-prices-with-a-special-discount-in-a-shop
1631-number-of-sub-arrays-with-odd-sum
1675-magnetic-force-between-two-balls
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1733-maximum-number-of-visible-points
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1755-defuse-the-bomb
1766-minimum-number-of-removals-to-make-mountain-array
1787-sum-of-absolute-differences-in-a-sorted-array
1819-construct-the-lexicographically-largest-valid-sequence
1876-map-of-highest-peak
1878-check-if-array-is-sorted-and-rotated
1886-minimum-limit-of-balls-in-a-bag
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1917-maximum-average-pass-ratio
1927-maximum-ascending-subarray-sum
1940-maximum-xor-for-each-query
1972-rotating-the-box
1983-maximum-population-year
2005-check-if-all-the-integers-in-a-range-are-covered
2035-count-sub-islands
2048-build-array-from-permutation
2054-the-number-of-the-smallest-unoccupied-chair
2058-concatenation-of-array
2089-maximum-matrix-sum
2103-find-all-groups-of-farmland
2107-find-unique-binary-string
2145-grid-game
2164-two-best-non-overlapping-events
2170-count-number-of-maximum-bitwise-or-subsets
2180-maximum-number-of-tasks-you-can-assign
2188-minimized-maximum-of-products-distributed-to-any-store
2215-finding-3-digit-even-numbers
2232-adding-spaces-to-a-string
2237-longest-palindrome-by-concatenating-two-letter-words
2265-partition-array-according-to-given-pivot
2343-count-unguarded-cells-in-the-grid
2356-largest-combination-with-bitwise-and-greater-than-zero
2358-number-of-ways-to-split-array
2375-minimum-obstacle-removal-to-reach-corner
2465-shifting-letters-ii
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2488-divide-intervals-into-minimum-number-of-groups
2533-bitwise-xor-of-all-pairings
2545-height-of-binary-tree-after-subtree-removal-queries
2552-maximum-sum-of-distinct-subarrays-with-length-k
2554-minimum-total-distance-traveled
2581-divide-players-into-teams-of-equal-skill
2586-longest-square-streak-in-an-array
2614-maximum-count-of-positive-integer-and-negative-integer
2616-maximal-score-after-applying-k-operations
2621-find-xor-beauty-of-array
2640-maximum-number-of-integers-to-choose-from-a-range-i
2685-first-completely-painted-row-or-column
2690-house-robber-iv
2691-count-vowel-strings-in-ranges
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
2699-count-the-number-of-fair-pairs
2707-merge-two-2d-arrays-by-summing-values
2711-minimum-time-to-visit-a-cell-in-a-grid
2716-prime-subtraction-operation
2720-minimize-the-maximum-difference-of-pairs
2764-maximum-number-of-fish-in-a-grid
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
2794-maximum-number-of-moves-in-a-grid
2868-continuous-subarrays
2891-maximum-beauty-of-an-array-after-applying-operation
3034-points-that-intersect-with-cars
3142-longest-unequal-adjacent-groups-subsequence-ii
3143-longest-unequal-adjacent-groups-subsequence-i
3151-minimum-processing-time
3171-minimum-equal-sum-of-two-arrays-after-replacing-zeros
3181-find-building-where-alice-and-bob-can-meet
3194-find-words-containing-character
3219-make-lexicographically-smallest-array-by-swapping-elements
3227-find-missing-and-repeated-values
3241-divide-array-into-arrays-with-max-difference
3264-maximum-points-after-enemy-battles
3291-find-if-array-can-be-sorted
3307-find-the-maximum-sum-of-node-values
3309-count-prefix-and-suffix-pairs-i
3321-type-of-triangle
3348-minimum-cost-walk-in-weighted-graph
3372-longest-strictly-increasing-or-strictly-decreasing-subarray
3380-shortest-subarray-with-or-at-least-k-ii
3427-special-array-ii
3429-special-array-i
3434-find-the-number-of-distinct-colors-among-the-balls
3461-find-the-minimum-area-to-cover-all-ones-i
3463-alternating-groups-i
3466-number-of-subarrays-with-and-value-of-k
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3476-find-minimum-operations-to-make-all-elements-divisible-by-three
3483-alternating-groups-ii
3492-count-submatrices-with-equal-frequency-of-x-and-y
3501-delete-nodes-from-linked-list-present-in-array
3517-shortest-distance-after-road-addition-queries-i
3522-find-the-power-of-k-size-subarrays-i
3555-final-array-state-after-k-multiplication-operations-i
3576-find-subtree-sizes-after-changes
3594-identify-the-largest-outlier-in-an-array
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii
3639-zero-array-transformation-i
3647-zero-array-transformation-iii
3716-longest-subsequence-with-decreasing-adjacent-difference
3747-maximum-difference-between-adjacent-elements-in-a-circular-array
3791-fruits-into-baskets-iii

Stack

0020-valid-parentheses
0042-trapping-rain-water
0232-implement-queue-using-stacks
0234-palindrome-linked-list
0780-max-chunks-to-make-sorted
1002-maximum-width-ramp
1197-parsing-a-boolean-expression
1298-reverse-substrings-between-each-pair-of-parentheses
1371-minimum-remove-to-make-valid-parentheses
1570-final-prices-with-a-special-discount-in-a-shop
1679-shortest-subarray-to-be-removed-to-make-array-sorted
2221-check-if-a-parentheses-string-can-be-valid
2456-construct-smallest-number-from-di-string
2520-using-a-robot-to-print-the-lexicographically-smallest-string
3181-find-building-where-alice-and-bob-can-meet
3445-lexicographically-minimum-string-after-removing-stars
3447-clear-digits

Monotonic Stack

0042-trapping-rain-water
0780-max-chunks-to-make-sorted
1002-maximum-width-ramp
1570-final-prices-with-a-special-discount-in-a-shop
1679-shortest-subarray-to-be-removed-to-make-array-sorted
3181-find-building-where-alice-and-bob-can-meet

String

0003-longest-substring-without-repeating-characters
0008-string-to-integer-atoi
0014-longest-common-prefix
0020-valid-parentheses
0049-group-anagrams
0058-length-of-last-word
0125-valid-palindrome
0131-palindrome-partitioning
0151-reverse-words-in-a-string
0242-valid-anagram
0257-binary-tree-paths
0306-additive-number
0392-is-subsequence
0812-rotate-string
0868-push-dominoes
0952-word-subsets
1058-lexicographically-smallest-equivalent-string
1093-recover-a-tree-from-preorder-traversal
1122-longest-duplicate-substring
1160-letter-tile-possibilities
1170-shortest-common-supersequence
1197-parsing-a-boolean-expression
1298-reverse-substrings-between-each-pair-of-parentheses
1302-delete-characters-to-make-fancy-string
1304-longest-happy-string
1350-remove-sub-folders-from-the-filesystem
1371-minimum-remove-to-make-valid-parentheses
1502-construct-k-palindrome-strings
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1632-number-of-good-ways-to-split-a-string
1667-find-kth-bit-in-nth-binary-string
1715-split-a-string-into-the-max-number-of-unique-substrings
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1890-sum-of-beauty-of-all-substrings
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1915-check-if-one-string-swap-can-make-strings-equal
2059-unique-length-3-palindromic-subsequences
2107-find-unique-binary-string
2221-check-if-a-parentheses-string-can-be-valid
2232-adding-spaces-to-a-string
2237-longest-palindrome-by-concatenating-two-letter-words
2300-construct-string-with-repeat-limit
2456-construct-smallest-number-from-di-string
2463-minimum-recolors-to-get-k-consecutive-black-blocks
2465-shifting-letters-ii
2520-using-a-robot-to-print-the-lexicographically-smallest-string
2580-circular-sentence
2599-take-k-of-each-character-from-left-and-right
2691-count-vowel-strings-in-ranges
3018-make-string-a-subsequence-using-cyclic-increments
3142-longest-unequal-adjacent-groups-subsequence-ii
3143-longest-unequal-adjacent-groups-subsequence-i
3174-minimum-number-of-changes-to-make-binary-string-beautiful
3194-find-words-containing-character
3195-separate-black-and-white-balls
3267-find-longest-special-substring-that-occurs-thrice-i
3309-count-prefix-and-suffix-pairs-i
3379-score-of-a-string
3405-count-the-number-of-special-characters-ii
3445-lexicographically-minimum-string-after-removing-stars
3447-clear-digits
3451-string-compression-iii
3453-generate-binary-strings-without-adjacent-zeros
3455-minimum-length-of-string-after-operations
3468-find-the-encrypted-string
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
3576-find-subtree-sizes-after-changes
3617-find-the-original-typed-string-i
3629-total-characters-in-string-after-transformations-i
3630-total-characters-in-string-after-transformations-ii
3637-count-number-of-balanced-permutations
3683-find-the-lexicographically-largest-string-from-the-box-i
3753-maximum-difference-between-even-and-odd-frequency-i

Linked List

0002-add-two-numbers
0021-merge-two-sorted-lists
0203-remove-linked-list-elements
0234-palindrome-linked-list
2903-insert-greatest-common-divisors-in-linked-list
3501-delete-nodes-from-linked-list-present-in-array

Math

0002-add-two-numbers
0007-reverse-integer
0009-palindrome-number
0149-max-points-on-a-line
0189-rotate-array
0202-happy-number
0231-power-of-two
0233-number-of-digit-one
0258-add-digits
0670-maximum-swap
1359-circular-permutation-in-binary-representation
1370-count-number-of-nice-subarrays
1529-max-difference-you-can-get-from-changing-an-integer
1585-the-kth-factor-of-n
1631-number-of-sub-arrays-with-odd-sum
1733-maximum-number-of-visible-points
1787-sum-of-absolute-differences-in-a-sorted-array
1889-check-if-number-is-a-sum-of-powers-of-three
2610-closest-prime-numbers-in-range
2621-find-xor-beauty-of-array
2704-maximum-difference-by-remapping-a-digit
2716-prime-subtraction-operation
2802-find-the-punishment-number-of-an-integer
2903-insert-greatest-common-divisors-in-linked-list
3172-divisible-and-non-divisible-sums-difference
3201-distribute-candies-among-children-ii
3227-find-missing-and-repeated-values
3321-type-of-triangle
3476-find-minimum-operations-to-make-all-elements-divisible-by-three
3555-final-array-state-after-k-multiplication-operations-i
3629-total-characters-in-string-after-transformations-i
3630-total-characters-in-string-after-transformations-ii
3637-count-number-of-balanced-permutations
3676-smallest-number-with-all-set-bits

Number Theory

0258-add-digits
1585-the-kth-factor-of-n
2610-closest-prime-numbers-in-range
2716-prime-subtraction-operation
2903-insert-greatest-common-divisors-in-linked-list

Simulation

0258-add-digits
1184-car-pooling
1667-find-kth-bit-in-nth-binary-string
2048-build-array-from-permutation
2058-concatenation-of-array
2232-adding-spaces-to-a-string
2265-partition-array-according-to-given-pivot
2343-count-unguarded-cells-in-the-grid
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
3434-find-the-number-of-distinct-colors-among-the-balls
3447-clear-digits
3555-final-array-state-after-k-multiplication-operations-i

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0049-group-anagrams
0073-set-matrix-zeroes
0149-max-points-on-a-line
0169-majority-element
0202-happy-number
0219-contains-duplicate-ii
0242-valid-anagram
0560-subarray-sum-equals-k
0632-smallest-range-covering-elements-from-k-lists
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0952-word-subsets
1147-flip-columns-for-maximum-number-of-equal-rows
1160-letter-tile-possibilities
1227-number-of-equivalent-domino-pairs
1364-tuple-with-same-product
1370-count-number-of-nice-subarrays
1387-find-elements-in-a-contaminated-binary-tree
1468-check-if-n-and-its-double-exist
1502-construct-k-palindrome-strings
1632-number-of-good-ways-to-split-a-string
1715-split-a-string-into-the-max-number-of-unique-substrings
1890-sum-of-beauty-of-all-substrings
1915-check-if-one-string-swap-can-make-strings-equal
1986-largest-color-value-in-a-directed-graph
2005-check-if-all-the-integers-in-a-range-are-covered
2054-the-number-of-the-smallest-unoccupied-chair
2059-unique-length-3-palindromic-subsequences
2107-find-unique-binary-string
2215-finding-3-digit-even-numbers
2237-longest-palindrome-by-concatenating-two-letter-words
2300-construct-string-with-repeat-limit
2356-largest-combination-with-bitwise-and-greater-than-zero
2434-design-a-number-container-system
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2520-using-a-robot-to-print-the-lexicographically-smallest-string
2552-maximum-sum-of-distinct-subarrays-with-length-k
2581-divide-players-into-teams-of-equal-skill
2586-longest-square-streak-in-an-array
2599-take-k-of-each-character-from-left-and-right
2640-maximum-number-of-integers-to-choose-from-a-range-i
2677-cousins-in-binary-tree-ii
2685-first-completely-painted-row-or-column
2695-find-score-of-an-array-after-marking-all-elements
2707-merge-two-2d-arrays-by-summing-values
2766-find-the-prefix-common-array-of-two-arrays
3034-points-that-intersect-with-cars
3227-find-missing-and-repeated-values
3267-find-longest-special-substring-that-occurs-thrice-i
3405-count-the-number-of-special-characters-ii
3434-find-the-number-of-distinct-colors-among-the-balls
3445-lexicographically-minimum-string-after-removing-stars
3455-minimum-length-of-string-after-operations
3501-delete-nodes-from-linked-list-present-in-array
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
3576-find-subtree-sizes-after-changes
3594-identify-the-largest-outlier-in-an-array
3629-total-characters-in-string-after-transformations-i
3630-total-characters-in-string-after-transformations-ii
3678-design-task-manager
3753-maximum-difference-between-even-and-odd-frequency-i

Heap (Priority Queue)

0239-sliding-window-maximum
0407-trapping-rain-water-ii
0502-ipo
0632-smallest-range-covering-elements-from-k-lists
0802-k-th-smallest-prime-fraction
0892-shortest-subarray-with-sum-at-least-k
1184-car-pooling
1304-longest-happy-string
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1917-maximum-average-pass-ratio
2054-the-number-of-the-smallest-unoccupied-chair
2164-two-best-non-overlapping-events
2300-construct-string-with-repeat-limit
2375-minimum-obstacle-removal-to-reach-corner
2379-maximum-total-importance-of-roads
2434-design-a-number-container-system
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
2711-minimum-time-to-visit-a-cell-in-a-grid
2868-continuous-subarrays
3181-find-building-where-alice-and-bob-can-meet
3445-lexicographically-minimum-string-after-removing-stars
3555-final-array-state-after-k-multiplication-operations-i
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii
3647-zero-array-transformation-iii
3678-design-task-manager

Two Pointers

0011-container-with-most-water
0026-remove-duplicates-from-sorted-array
0027-remove-element
0042-trapping-rain-water
0075-sort-colors
0080-remove-duplicates-from-sorted-array-ii
0088-merge-sorted-array
0125-valid-palindrome
0151-reverse-words-in-a-string
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0202-happy-number
0234-palindrome-linked-list
0392-is-subsequence
0802-k-th-smallest-prime-fraction
0868-push-dominoes
1468-check-if-n-and-its-double-exist
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1972-rotating-the-box
2180-maximum-number-of-tasks-you-can-assign
2232-adding-spaces-to-a-string
2265-partition-array-according-to-given-pivot
2488-divide-intervals-into-minimum-number-of-groups
2581-divide-players-into-teams-of-equal-skill
2699-count-the-number-of-fair-pairs
2707-merge-two-2d-arrays-by-summing-values
3018-make-string-a-subsequence-using-cyclic-increments
3195-separate-black-and-white-balls
3683-find-the-lexicographically-largest-string-from-the-box-i

Greedy

0011-container-with-most-water
0045-jump-game-ii
0055-jump-game
0122-best-time-to-buy-and-sell-stock-ii
0134-gas-station
0135-candy
0452-minimum-number-of-arrows-to-burst-balloons
0502-ipo
0632-smallest-range-covering-elements-from-k-lists
0670-maximum-swap
0714-best-time-to-buy-and-sell-stock-with-transaction-fee
0780-max-chunks-to-make-sorted
1049-minimum-domino-rotations-for-equal-row
1304-longest-happy-string
1502-construct-k-palindrome-strings
1529-max-difference-you-can-get-from-changing-an-integer
1766-minimum-number-of-removals-to-make-mountain-array
1917-maximum-average-pass-ratio
2089-maximum-matrix-sum
2180-maximum-number-of-tasks-you-can-assign
2221-check-if-a-parentheses-string-can-be-valid
2237-longest-palindrome-by-concatenating-two-letter-words
2300-construct-string-with-repeat-limit
2379-maximum-total-importance-of-roads
2456-construct-smallest-number-from-di-string
2488-divide-intervals-into-minimum-number-of-groups
2509-minimize-xor
2520-using-a-robot-to-print-the-lexicographically-smallest-string
2616-maximal-score-after-applying-k-operations
2640-maximum-number-of-integers-to-choose-from-a-range-i
2704-maximum-difference-by-remapping-a-digit
2716-prime-subtraction-operation
2720-minimize-the-maximum-difference-of-pairs
3143-longest-unequal-adjacent-groups-subsequence-i
3151-minimum-processing-time
3171-minimum-equal-sum-of-two-arrays-after-replacing-zeros
3195-separate-black-and-white-balls
3241-divide-array-into-arrays-with-max-difference
3264-maximum-points-after-enemy-battles
3307-find-the-maximum-sum-of-node-values
3445-lexicographically-minimum-string-after-removing-stars
3647-zero-array-transformation-iii

Sorting

0049-group-anagrams
0075-sort-colors
0088-merge-sorted-array
0169-majority-element
0220-contains-duplicate-iii
0242-valid-anagram
0452-minimum-number-of-arrows-to-burst-balloons
0502-ipo
0632-smallest-range-covering-elements-from-k-lists
0780-max-chunks-to-make-sorted
0802-k-th-smallest-prime-fraction
1184-car-pooling
1468-check-if-n-and-its-double-exist
1675-magnetic-force-between-two-balls
1733-maximum-number-of-visible-points
2164-two-best-non-overlapping-events
2180-maximum-number-of-tasks-you-can-assign
2215-finding-3-digit-even-numbers
2379-maximum-total-importance-of-roads
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2488-divide-intervals-into-minimum-number-of-groups
2554-minimum-total-distance-traveled
2581-divide-players-into-teams-of-equal-skill
2586-longest-square-streak-in-an-array
2640-maximum-number-of-integers-to-choose-from-a-range-i
2646-kth-largest-sum-in-a-binary-tree
2695-find-score-of-an-array-after-marking-all-elements
2699-count-the-number-of-fair-pairs
2891-maximum-beauty-of-an-array-after-applying-operation
3151-minimum-processing-time
3219-make-lexicographically-smallest-array-by-swapping-elements
3241-divide-array-into-arrays-with-max-difference
3291-find-if-array-can-be-sorted
3307-find-the-maximum-sum-of-node-values
3321-type-of-triangle
3647-zero-array-transformation-iii

Prefix Sum

0238-product-of-array-except-self
0560-subarray-sum-equals-k
0731-my-calendar-ii
0892-shortest-subarray-with-sum-at-least-k
1184-car-pooling
1370-count-number-of-nice-subarrays
1537-maximum-score-after-splitting-a-string
1631-number-of-sub-arrays-with-odd-sum
1787-sum-of-absolute-differences-in-a-sorted-array
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1940-maximum-xor-for-each-query
1983-maximum-population-year
2005-check-if-all-the-integers-in-a-range-are-covered
2059-unique-length-3-palindromic-subsequences
2145-grid-game
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
2488-divide-intervals-into-minimum-number-of-groups
2691-count-vowel-strings-in-ranges
3034-points-that-intersect-with-cars
3427-special-array-ii
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3492-count-submatrices-with-equal-frequency-of-x-and-y
3639-zero-array-transformation-i
3647-zero-array-transformation-iii

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists
0203-remove-linked-list-elements
0231-power-of-two
0233-number-of-digit-one
0234-palindrome-linked-list
1197-parsing-a-boolean-expression
1667-find-kth-bit-in-nth-binary-string

Sliding Window

0003-longest-substring-without-repeating-characters
0219-contains-duplicate-ii
0220-contains-duplicate-iii
0239-sliding-window-maximum
0632-smallest-range-covering-elements-from-k-lists
0892-shortest-subarray-with-sum-at-least-k
1122-longest-duplicate-substring
1370-count-number-of-nice-subarrays
1445-number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold
1733-maximum-number-of-visible-points
1755-defuse-the-bomb
2463-minimum-recolors-to-get-k-consecutive-black-blocks
2552-maximum-sum-of-distinct-subarrays-with-length-k
2599-take-k-of-each-character-from-left-and-right
2868-continuous-subarrays
2891-maximum-beauty-of-an-array-after-applying-operation
3267-find-longest-special-substring-that-occurs-thrice-i
3380-shortest-subarray-with-or-at-least-k-ii
3463-alternating-groups-i
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii
3522-find-the-power-of-k-size-subarrays-i
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii

Binary Search

0004-median-of-two-sorted-arrays
0167-two-sum-ii-input-array-is-sorted
0731-my-calendar-ii
0802-k-th-smallest-prime-fraction
0892-shortest-subarray-with-sum-at-least-k
1122-longest-duplicate-substring
1335-maximum-candies-allocated-to-k-children
1468-check-if-n-and-its-double-exist
1675-magnetic-force-between-two-balls
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1766-minimum-number-of-removals-to-make-mountain-array
1886-minimum-limit-of-balls-in-a-bag
2164-two-best-non-overlapping-events
2180-maximum-number-of-tasks-you-can-assign
2188-minimized-maximum-of-products-distributed-to-any-store
2586-longest-square-streak-in-an-array
2614-maximum-count-of-positive-integer-and-negative-integer
2640-maximum-number-of-integers-to-choose-from-a-range-i
2690-house-robber-iv
2699-count-the-number-of-fair-pairs
2716-prime-subtraction-operation
2720-minimize-the-maximum-difference-of-pairs
2891-maximum-beauty-of-an-array-after-applying-operation
3181-find-building-where-alice-and-bob-can-meet
3267-find-longest-special-substring-that-occurs-thrice-i
3427-special-array-ii
3466-number-of-subarrays-with-and-value-of-k
3791-fruits-into-baskets-iii

Divide and Conquer

0004-median-of-two-sorted-arrays
0169-majority-element
0925-construct-binary-tree-from-preorder-and-postorder-traversal

Matrix

0073-set-matrix-zeroes
0200-number-of-islands
0407-trapping-rain-water-ii
0787-sliding-puzzle
0945-snakes-and-ladders
1147-flip-columns-for-maximum-number-of-equal-rows
1396-count-servers-that-communicate
1402-count-square-submatrices-with-all-ones
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1876-map-of-highest-peak
1972-rotating-the-box
2035-count-sub-islands
2089-maximum-matrix-sum
2103-find-all-groups-of-farmland
2145-grid-game
2343-count-unguarded-cells-in-the-grid
2375-minimum-obstacle-removal-to-reach-corner
2685-first-completely-painted-row-or-column
2711-minimum-time-to-visit-a-cell-in-a-grid
2764-maximum-number-of-fish-in-a-grid
2794-maximum-number-of-moves-in-a-grid
3227-find-missing-and-repeated-values
3461-find-the-minimum-area-to-cover-all-ones-i
3492-count-submatrices-with-equal-frequency-of-x-and-y
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii

Depth-First Search

0200-number-of-islands
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0257-binary-tree-paths
0386-lexicographical-numbers
0515-find-largest-value-in-each-tree-row
0684-redundant-connection
0988-flip-equivalent-binary-trees
1005-univalued-binary-tree
1093-recover-a-tree-from-preorder-traversal
1350-remove-sub-folders-from-the-filesystem
1387-find-elements-in-a-contaminated-binary-tree
1396-count-servers-that-communicate
1558-course-schedule-iv
2035-count-sub-islands
2103-find-all-groups-of-farmland
2201-valid-arrangement-of-pairs
2246-maximum-employees-to-be-invited-to-a-meeting
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2677-cousins-in-binary-tree-ii
2764-maximum-number-of-fish-in-a-grid
3439-find-minimum-diameter-after-merging-two-trees
3576-find-subtree-sizes-after-changes
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii

Breadth-First Search

0200-number-of-islands
0407-trapping-rain-water-ii
0515-find-largest-value-in-each-tree-row
0684-redundant-connection
0787-sliding-puzzle
0945-snakes-and-ladders
1005-univalued-binary-tree
1387-find-elements-in-a-contaminated-binary-tree
1396-count-servers-that-communicate
1424-maximum-candies-you-can-get-from-boxes
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1558-course-schedule-iv
1876-map-of-highest-peak
2035-count-sub-islands
2103-find-all-groups-of-farmland
2375-minimum-obstacle-removal-to-reach-corner
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii
2711-minimum-time-to-visit-a-cell-in-a-grid
2764-maximum-number-of-fish-in-a-grid
3439-find-minimum-diameter-after-merging-two-trees
3517-shortest-distance-after-road-addition-queries-i
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii

Union Find

0200-number-of-islands
0684-redundant-connection
1058-lexicographically-smallest-equivalent-string
1396-count-servers-that-communicate
2035-count-sub-islands
2764-maximum-number-of-fish-in-a-grid
3219-make-lexicographically-smallest-array-by-swapping-elements
3348-minimum-cost-walk-in-weighted-graph

Bit Manipulation

0201-bitwise-and-of-numbers-range
0231-power-of-two
0260-single-number-iii
1359-circular-permutation-in-binary-representation
1632-number-of-good-ways-to-split-a-string
1940-maximum-xor-for-each-query
2059-unique-length-3-palindromic-subsequences
2170-count-number-of-maximum-bitwise-or-subsets
2356-largest-combination-with-bitwise-and-greater-than-zero
2509-minimize-xor
2533-bitwise-xor-of-all-pairings
2621-find-xor-beauty-of-array
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
3291-find-if-array-can-be-sorted
3307-find-the-maximum-sum-of-node-values
3348-minimum-cost-walk-in-weighted-graph
3380-shortest-subarray-with-or-at-least-k-ii
3394-minimum-array-end
3453-generate-binary-strings-without-adjacent-zeros
3466-number-of-subarrays-with-and-value-of-k
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3676-smallest-number-with-all-set-bits

Queue

0232-implement-queue-using-stacks
0239-sliding-window-maximum
0892-shortest-subarray-with-sum-at-least-k
2180-maximum-number-of-tasks-you-can-assign
2868-continuous-subarrays
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

Dynamic Programming

0042-trapping-rain-water
0045-jump-game-ii
0055-jump-game
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0131-palindrome-partitioning
0233-number-of-digit-one
0392-is-subsequence
0689-maximum-sum-of-3-non-overlapping-subarrays
0714-best-time-to-buy-and-sell-stock-with-transaction-fee
0806-domino-and-tromino-tiling
0868-push-dominoes
0905-length-of-longest-fibonacci-subsequence
1025-minimum-cost-for-tickets
1063-best-sightseeing-pair
1170-shortest-common-supersequence
1402-count-square-submatrices-with-all-ones
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1511-count-number-of-teams
1631-number-of-sub-arrays-with-odd-sum
1632-number-of-good-ways-to-split-a-string
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1766-minimum-number-of-removals-to-make-mountain-array
1986-largest-color-value-in-a-directed-graph
2164-two-best-non-overlapping-events
2554-minimum-total-distance-traveled
2562-count-ways-to-build-good-strings
2586-longest-square-streak-in-an-array
2794-maximum-number-of-moves-in-a-grid
3142-longest-unequal-adjacent-groups-subsequence-ii
3143-longest-unequal-adjacent-groups-subsequence-i
3307-find-the-maximum-sum-of-node-values
3629-total-characters-in-string-after-transformations-i
3630-total-characters-in-string-after-transformations-ii
3637-count-number-of-balanced-permutations
3716-longest-subsequence-with-decreasing-adjacent-difference

Binary Indexed Tree

1511-count-number-of-teams
3181-find-building-where-alice-and-bob-can-meet

Segment Tree

0731-my-calendar-ii
1511-count-number-of-teams
3181-find-building-where-alice-and-bob-can-meet
3466-number-of-subarrays-with-and-value-of-k
3791-fruits-into-baskets-iii

Backtracking

0131-palindrome-partitioning
0257-binary-tree-paths
0306-additive-number
1160-letter-tile-possibilities
1359-circular-permutation-in-binary-representation
1715-split-a-string-into-the-max-number-of-unique-substrings
1819-construct-the-lexicographically-largest-valid-sequence
2107-find-unique-binary-string
2170-count-number-of-maximum-bitwise-or-subsets
2456-construct-smallest-number-from-di-string
2802-find-the-punishment-number-of-an-integer
3453-generate-binary-strings-without-adjacent-zeros

Counting

0169-majority-element
1160-letter-tile-possibilities
1227-number-of-equivalent-domino-pairs
1364-tuple-with-same-product
1396-count-servers-that-communicate
1502-construct-k-palindrome-strings
1890-sum-of-beauty-of-all-substrings
1915-check-if-one-string-swap-can-make-strings-equal
1983-maximum-population-year
1986-largest-color-value-in-a-directed-graph
2237-longest-palindrome-by-concatenating-two-letter-words
2300-construct-string-with-repeat-limit
2356-largest-combination-with-bitwise-and-greater-than-zero
2614-maximum-count-of-positive-integer-and-negative-integer
3267-find-longest-special-substring-that-occurs-thrice-i
3455-minimum-length-of-string-after-operations
3594-identify-the-largest-outlier-in-an-array
3629-total-characters-in-string-after-transformations-i
3630-total-characters-in-string-after-transformations-ii
3753-maximum-difference-between-even-and-odd-frequency-i

Enumeration

2170-count-number-of-maximum-bitwise-or-subsets
2215-finding-3-digit-even-numbers
3201-distribute-candies-among-children-ii
3594-identify-the-largest-outlier-in-an-array
3683-find-the-lexicographically-largest-string-from-the-box-i

Graph

0684-redundant-connection
1424-maximum-candies-you-can-get-from-boxes
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1558-course-schedule-iv
1986-largest-color-value-in-a-directed-graph
2201-valid-arrangement-of-pairs
2246-maximum-employees-to-be-invited-to-a-meeting
2375-minimum-obstacle-removal-to-reach-corner
2379-maximum-total-importance-of-roads
2711-minimum-time-to-visit-a-cell-in-a-grid
3189-find-champion-ii
3348-minimum-cost-walk-in-weighted-graph
3439-find-minimum-diameter-after-merging-two-trees
3517-shortest-distance-after-road-addition-queries-i
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii

Tree

0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0257-binary-tree-paths
0515-find-largest-value-in-each-tree-row
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0988-flip-equivalent-binary-trees
1005-univalued-binary-tree
1093-recover-a-tree-from-preorder-traversal
1387-find-elements-in-a-contaminated-binary-tree
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii
3307-find-the-maximum-sum-of-node-values
3439-find-minimum-diameter-after-merging-two-trees
3576-find-subtree-sizes-after-changes
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii

Binary Tree

0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0257-binary-tree-paths
0515-find-largest-value-in-each-tree-row
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0988-flip-equivalent-binary-trees
1005-univalued-binary-tree
1093-recover-a-tree-from-preorder-traversal
1387-find-elements-in-a-contaminated-binary-tree
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Shortest Path

1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii

Trie

0014-longest-common-prefix
0386-lexicographical-numbers
0440-k-th-smallest-in-lexicographical-order
1350-remove-sub-folders-from-the-filesystem
3309-count-prefix-and-suffix-pairs-i

Geometry

0149-max-points-on-a-line
1733-maximum-number-of-visible-points

Design

0232-implement-queue-using-stacks
0731-my-calendar-ii
1387-find-elements-in-a-contaminated-binary-tree
2434-design-a-number-container-system
3678-design-task-manager

Ordered Set

0220-contains-duplicate-iii
0731-my-calendar-ii
2434-design-a-number-container-system
2868-continuous-subarrays
3678-design-task-manager
3791-fruits-into-baskets-iii

String Matching

0812-rotate-string
1524-string-matching-in-an-array
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
3309-count-prefix-and-suffix-pairs-i

Database

0180-consecutive-numbers
0182-duplicate-emails
0610-triangle-judgement
0626-exchange-seats
1523-capital-gainloss
2110-employees-with-missing-information

Bucket Sort

0220-contains-duplicate-iii

Monotonic Queue

0239-sliding-window-maximum
0892-shortest-subarray-with-sum-at-least-k
2180-maximum-number-of-tasks-you-can-assign
2868-continuous-subarrays

Eulerian Circuit

2201-valid-arrangement-of-pairs

Rolling Hash

1122-longest-duplicate-substring
3309-count-prefix-and-suffix-pairs-i

Suffix Array

1122-longest-duplicate-substring

Hash Function

1122-longest-duplicate-substring
3309-count-prefix-and-suffix-pairs-i

Brainteaser

2533-bitwise-xor-of-all-pairings

Topological Sort

1558-course-schedule-iv
1986-largest-color-value-in-a-directed-graph
2246-maximum-employees-to-be-invited-to-a-meeting

Combinatorics

3201-distribute-candies-among-children-ii
3637-count-number-of-balanced-permutations

Binary Search Tree

0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree

Memoization

1986-largest-color-value-in-a-directed-graph

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published