Skip to content

A collection of LeetCode questions to ace the coding interview! - Created using [LeetHub v2](https://github.com/arunbhardwaj/LeetHub-2.0)

Notifications You must be signed in to change notification settings

4-Ford204/LeetCode-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,109 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode-Algorithm

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

LeetCode Topics

Dynamic Programming

0338-counting-bits
0435-non-overlapping-intervals
0712-minimum-ascii-delete-sum-for-two-strings
0806-domino-and-tromino-tiling
0747-min-cost-climbing-stairs
0740-delete-and-earn
0392-is-subsequence
1586-longest-subarray-of-1s-after-deleting-one-element
1474-longest-zigzag-path-in-a-binary-tree
2164-two-best-non-overlapping-events
0718-maximum-length-of-repeated-subarray
0494-target-sum
1063-best-sightseeing-pair
2562-count-ways-to-build-good-strings
1025-minimum-cost-for-tickets
0689-maximum-sum-of-3-non-overlapping-subarrays
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1631-number-of-sub-arrays-with-odd-sum
1849-maximum-absolute-sum-of-any-subarray
0905-length-of-longest-fibonacci-subsequence
1170-shortest-common-supersequence
1402-count-square-submatrices-with-all-ones
2262-solving-questions-with-brainpower
0416-partition-equal-subset-sum
0368-largest-divisible-subset
3243-count-the-number-of-powerful-integers
2415-count-the-number-of-ideal-arrays
0868-push-dominoes
3637-count-number-of-balanced-permutations
3629-total-characters-in-string-after-transformations-i
3143-longest-unequal-adjacent-groups-subsequence-i
2395-longest-binary-subsequence-less-than-or-equal-to-k
0934-bitwise-ors-of-subarrays
0118-pascals-triangle
0122-best-time-to-buy-and-sell-stock-ii
0826-soup-servings
0055-jump-game
2882-ways-to-express-an-integer-as-sum-of-powers
0867-new-21-game
1628-count-submatrices-with-all-ones
0121-best-time-to-buy-and-sell-stock
2408-number-of-people-aware-of-a-secret
0120-triangle
1111-minimum-score-triangulation-of-polygon
1633-minimum-number-of-increments-on-subarrays-to-form-a-target-array
1700-minimum-time-to-make-rope-colorful
1732-minimum-one-bit-operations-to-make-integers-zero
0474-ones-and-zeroes
1262-greatest-sum-divisible-by-three
2435-paths-in-matrix-whose-sum-is-divisible-by-k
2147-number-of-ways-to-divide-a-long-corridor
2110-number-of-smooth-descent-periods-of-a-stock
2054-two-best-non-overlapping-events
1411-number-of-ways-to-paint-n-3-grid
1458-max-dot-product-of-two-subsequences

Bit Manipulation

0338-counting-bits
0136-single-number
1441-minimum-flips-to-make-a-or-b-equal-to-c
0222-count-complete-tree-nodes
2059-unique-length-3-palindromic-subsequences
2766-find-the-prefix-common-array-of-two-arrays
2509-minimize-xor
2533-bitwise-xor-of-all-pairings
2792-neighboring-bitwise-xor
0067-add-binary
2308-divide-array-into-equal-pairs
2478-longest-nice-subarray
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3348-minimum-cost-walk-in-weighted-graph
1993-sum-of-all-subset-xor-totals
3600-find-the-k-th-character-in-string-game-i
3601-find-the-k-th-character-in-string-game-ii
2170-count-number-of-maximum-bitwise-or-subsets
2498-smallest-subarrays-with-maximum-bitwise-or
0371-sum-of-two-integers
2503-longest-subarray-with-maximum-bitwise-and
0934-bitwise-ors-of-subarrays
0231-power-of-two
2529-range-product-queries-of-powers
0342-power-of-four
2837-minimum-operations-to-make-the-integer-zero
3676-smallest-number-with-all-set-bits
1732-minimum-one-bit-operations-to-make-integers-zero
1018-binary-prefix-divisible-by-5
3314-construct-the-minimum-bitwise-array-i
3315-construct-the-minimum-bitwise-array-ii

Array

0136-single-number
1397-search-suggestions-system
1755-defuse-the-bomb
0435-non-overlapping-intervals
2552-maximum-sum-of-distinct-subarrays-with-length-k
0452-minimum-number-of-arrows-to-burst-balloons
0001-two-sum
1036-rotting-oranges
0870-magic-squares-in-grid
0747-min-cost-climbing-stairs
0740-delete-and-earn
0745-find-smallest-letter-greater-than-target
1528-kids-with-the-greatest-number-of-candies
0739-daily-temperatures
2343-count-unguarded-cells-in-the-grid
0605-can-place-flowers
0238-product-of-array-except-self
0334-increasing-triplet-subsequence
1147-flip-columns-for-maximum-number-of-equal-rows
0283-move-zeroes
1972-rotating-the-box
0787-sliding-puzzle
0011-container-with-most-water
1798-max-number-of-k-sum-pairs
0643-maximum-average-subarray-i
1046-max-consecutive-ones-iii
1586-longest-subarray-of-1s-after-deleting-one-element
0015-3sum
1833-find-the-highest-altitude
0724-find-pivot-index
0209-minimum-size-subarray-sum
1392-find-the-difference-of-two-arrays
3517-shortest-distance-after-road-addition-queries-i
1319-unique-number-of-occurrences
2428-equal-row-and-column-pairs
2375-minimum-obstacle-removal-to-reach-corner
0735-asteroid-collision
1468-check-if-n-and-its-double-exist
2232-adding-spaces-to-a-string
0399-evaluate-division
2038-nearest-exit-from-entrance-in-maze
0215-kth-largest-element-in-an-array
2636-maximum-subsequence-score
2553-total-cost-to-hire-k-workers
2640-maximum-number-of-integers-to-choose-from-a-range-i
2392-successful-pairs-of-spells-and-potions
0162-find-peak-element
0907-koko-eating-bananas
1886-minimum-limit-of-balls-in-a-bag
2164-two-best-non-overlapping-events
3427-special-array-ii
0035-search-insert-position
3651-transformed-array
2891-maximum-beauty-of-an-array-after-applying-operation
0216-combination-sum-iii
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
2868-continuous-subarrays
1917-maximum-average-pass-ratio
3555-final-array-state-after-k-multiplication-operations-i
0718-maximum-length-of-repeated-subarray
1570-final-prices-with-a-special-discount-in-a-shop
0780-max-chunks-to-make-sorted
0494-target-sum
1063-best-sightseeing-pair
1025-minimum-cost-for-tickets
2691-count-vowel-strings-in-ranges
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1524-string-matching-in-an-array
3309-count-prefix-and-suffix-pairs-i
2292-counting-words-with-a-given-prefix
0952-word-subsets
2766-find-the-prefix-common-array-of-two-arrays
2533-bitwise-xor-of-all-pairings
0689-maximum-sum-of-3-non-overlapping-subarrays
2792-neighboring-bitwise-xor
2685-first-completely-painted-row-or-column
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2145-grid-game
1876-map-of-highest-peak
0407-trapping-rain-water-ii
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1396-count-servers-that-communicate
2764-maximum-number-of-fish-in-a-grid
3219-make-lexicographically-smallest-array-by-swapping-elements
3372-longest-strictly-increasing-or-strictly-decreasing-subarray
1878-check-if-array-is-sorted-and-rotated
3429-special-array-i
1927-maximum-ascending-subarray-sum
0854-making-a-large-island
1364-tuple-with-same-product
3434-find-the-number-of-distinct-colors-among-the-balls
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
3332-minimum-operations-to-exceed-threshold-value-ii
1477-product-of-the-last-k-numbers
2107-find-unique-binary-string
1819-construct-the-lexicographically-largest-valid-sequence
2564-most-profitable-path-in-a-tree
1631-number-of-sub-arrays-with-odd-sum
1849-maximum-absolute-sum-of-any-subarray
0905-length-of-longest-fibonacci-subsequence
2551-apply-operations-to-an-array
2265-partition-array-according-to-given-pivot
3227-find-missing-and-repeated-values
3483-alternating-groups-ii
2614-maximum-count-of-positive-integer-and-negative-integer
3643-zero-array-transformation-ii
1335-maximum-candies-allocated-to-k-children
2690-house-robber-iv
2665-minimum-time-to-repair-cars
2308-divide-array-into-equal-pairs
2478-longest-nice-subarray
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3348-minimum-cost-walk-in-weighted-graph
2220-find-all-possible-recipes-from-given-supplies
3430-count-days-without-meetings
0026-remove-duplicates-from-sorted-array
3657-check-if-grid-can-be-cut-into-sections
2160-minimum-operations-to-make-a-uni-value-grid
2888-minimum-index-of-a-valid-split
1402-count-square-submatrices-with-all-ones
2588-maximum-number-of-points-from-grid-queries
2681-put-marbles-in-bags
2262-solving-questions-with-brainpower
3154-maximum-value-of-an-ordered-triplet-i
3152-maximum-value-of-an-ordered-triplet-ii
0416-partition-equal-subset-sum
1993-sum-of-all-subset-xor-totals
0368-largest-divisible-subset
3656-minimum-number-of-operations-to-make-elements-in-array-distinct
3621-minimum-operations-to-make-array-values-equal-to-k
1656-count-good-triplets
2280-count-good-triplets-in-an-array
2626-count-the-number-of-good-subarrays
2277-count-equal-and-divisible-pairs-in-an-array
2699-count-the-number-of-fair-pairs
0797-rabbits-in-forest
2249-count-the-hidden-sequences
2856-count-complete-subarrays-in-an-array
2915-count-of-interesting-subarrays
2527-count-subarrays-with-fixed-bounds
3685-count-subarrays-of-length-three-with-a-condition
2394-count-subarrays-with-score-less-than-k
3213-count-subarrays-where-max-element-appears-at-least-k-times
1421-find-numbers-with-even-number-of-digits
1049-minimum-domino-rotations-for-equal-row
1227-number-of-equivalent-domino-pairs
2048-build-array-from-permutation
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii
3171-minimum-equal-sum-of-two-arrays-after-replacing-zeros
1293-three-consecutive-odds
2215-finding-3-digit-even-numbers
3143-longest-unequal-adjacent-groups-subsequence-i
0075-sort-colors
3321-type-of-triangle
3639-zero-array-transformation-i
0073-set-matrix-zeroes
3647-zero-array-transformation-iii
3194-find-words-containing-character
2237-longest-palindrome-by-concatenating-two-letter-words
0945-snakes-and-ladders
0135-candy
1424-maximum-candies-you-can-get-from-boxes
3747-maximum-difference-between-adjacent-elements-in-a-circular-array
2720-minimize-the-maximum-difference-of-pairs
2144-maximum-difference-between-increasing-elements
3241-divide-array-into-arrays-with-max-difference
2387-partition-array-such-that-maximum-difference-is-k
2320-find-all-k-distant-indices-in-an-array
2204-find-subsequence-of-length-k-with-the-largest-sum
0594-longest-harmonious-subsequence
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
1510-find-lucky-integer-in-an-array
1995-finding-pairs-with-a-certain-sum
3743-reschedule-meetings-for-maximum-free-time-i
0978-valid-mountain-array
2497-maximum-matching-of-players-with-trainers
1350-remove-sub-folders-from-the-filesystem
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0027-remove-element
3788-maximum-unique-subarray-sum-after-deletion
0088-merge-sorted-array
2316-count-hills-and-valleys-in-an-array
2170-count-number-of-maximum-bitwise-or-subsets
2498-smallest-subarrays-with-maximum-bitwise-or
2503-longest-subarray-with-maximum-bitwise-and
0080-remove-duplicates-from-sorted-array-ii
0934-bitwise-ors-of-subarrays
0118-pascals-triangle
0940-fruit-into-baskets
0189-rotate-array
0169-majority-element
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii
0307-range-sum-query-mutable
0122-best-time-to-buy-and-sell-stock-ii
0055-jump-game
2529-range-product-queries-of-powers
0047-permutations-ii
0274-h-index
0380-insert-delete-getrandom-o1
0134-gas-station
2432-number-of-zero-filled-subarrays
1628-count-submatrices-with-all-ones
3461-find-the-minimum-area-to-cover-all-ones-i
0121-best-time-to-buy-and-sell-stock
0498-diagonal-traverse
3251-maximum-area-of-longest-diagonal-rectangle
0167-two-sum-ii-input-array-is-sorted
0049-group-anagrams
0128-longest-consecutive-sequence
3748-sort-matrix-by-diagonals
0228-summary-ranges
0036-valid-sudoku
0054-spiral-matrix
1426-find-n-unique-integers-sum-up-to-zero
0048-rotate-image
1834-minimum-number-of-people-to-teach
2307-replace-non-coprime-numbers-in-array
0219-contains-duplicate-ii
0289-game-of-life
2429-design-a-food-rating-system
3797-design-spreadsheet
3242-count-elements-with-maximum-frequency
0120-triangle
0611-valid-triangle-number
0830-largest-triangle-area
1018-largest-perimeter-triangle
1111-minimum-score-triangulation-of-polygon
2324-find-triangular-sum-of-an-array
0417-pacific-atlantic-water-flow
1612-avoid-flood-in-the-city
3794-find-the-minimum-amount-of-time-to-brew-potions
3383-taking-maximum-energy-from-the-mystic-dungeon
1353-find-resultant-array-after-removing-anagrams
3612-adjacent-increasing-subarrays-detection-i
2661-smallest-missing-non-negative-integer-after-operations
3620-maximum-number-of-distinct-elements-after-operations
2137-final-value-of-variable-after-performing-operations
3622-maximum-frequency-of-an-element-after-performing-operations-i
2244-number-of-laser-beams-in-a-bank
3616-make-array-elements-equal-to-zero
1633-minimum-number-of-increments-on-subarrays-to-form-a-target-array
3581-the-two-sneaky-numbers-of-digitville
3501-delete-nodes-from-linked-list-present-in-array
1700-minimum-time-to-make-rope-colorful
3610-find-x-sum-of-all-k-long-subarrays-i
0474-ones-and-zeroes
2753-minimum-number-of-operations-to-make-all-array-elements-equal-to-1
2625-increment-submatrices-by-one
1548-check-if-all-1s-are-at-least-length-k-places-away
0717-1-bit-and-2-bit-characters
2274-keep-multiplying-found-values-by-two
3190-find-minimum-operations-to-make-all-elements-divisible-by-three
1262-greatest-sum-divisible-by-three
1018-binary-prefix-divisible-by-5
2435-paths-in-matrix-whose-sum-is-divisible-by-k
3381-maximum-subarray-sum-with-length-divisible-by-k
3512-minimum-operations-to-make-array-sum-divisible-by-k
2141-maximum-running-time-of-n-computers
3623-count-number-of-trapezoids-i
3625-count-number-of-trapezoids-ii
3432-count-partitions-with-even-sum-difference
3583-count-special-triplets
3577-count-the-number-of-computer-unlocking-permutations
3433-count-mentions-per-user
3606-coupon-code-validator
2110-number-of-smooth-descent-periods-of-a-stock
0944-delete-columns-to-make-sorted
2054-two-best-non-overlapping-events
3074-apple-redistribution-into-boxes
3075-maximize-happiness-of-selected-children
2402-meeting-rooms-iii
1351-count-negative-numbers-in-a-sorted-matrix
0840-magic-squares-in-grid
0066-plus-one
0961-n-repeated-element-in-size-2n-array
1390-four-divisors
1975-maximum-matrix-sum
1458-max-dot-product-of-two-subsequences
1266-minimum-time-visiting-all-points
3453-separate-squares-i
1929-concatenation-of-array
3314-construct-the-minimum-bitwise-array-i
3315-construct-the-minimum-bitwise-array-ii
3507-minimum-pair-removal-to-sort-array-i
1877-minimize-maximum-pair-sum-in-array
1984-minimum-difference-between-highest-and-lowest-of-k-scores
1200-minimum-absolute-difference
1470-shuffle-the-array
0485-max-consecutive-ones
3010-divide-an-array-into-subarrays-with-minimum-cost-i
3637-trionic-array-i
0448-find-all-numbers-disappeared-in-an-array

Hash Table

0208-implement-trie-prefix-tree
2552-maximum-sum-of-distinct-subarrays-with-length-k
0001-two-sum
0870-magic-squares-in-grid
0740-delete-and-earn
2599-take-k-of-each-character-from-left-and-right
1147-flip-columns-for-maximum-number-of-equal-rows
1798-max-number-of-k-sum-pairs
0003-longest-substring-without-repeating-characters
1392-find-the-difference-of-two-arrays
1319-unique-number-of-occurrences
1777-determine-if-two-strings-are-close
2428-equal-row-and-column-pairs
1468-check-if-n-and-its-double-exist
2413-smallest-number-in-infinite-set
2640-maximum-number-of-integers-to-choose-from-a-range-i
3267-find-longest-special-substring-that-occurs-thrice-i
0017-letter-combinations-of-a-phone-number
2695-find-score-of-an-array-after-marking-all-elements
2300-construct-string-with-repeat-limit
2059-unique-length-3-palindromic-subsequences
0952-word-subsets
1502-construct-k-palindrome-strings
3455-minimum-length-of-string-after-operations
2766-find-the-prefix-common-array-of-two-arrays
2685-first-completely-painted-row-or-column
1915-check-if-one-string-swap-can-make-strings-equal
1364-tuple-with-same-product
3434-find-the-number-of-distinct-colors-among-the-balls
2434-design-a-number-container-system
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
1160-letter-tile-possibilities
2107-find-unique-binary-string
1387-find-elements-in-a-contaminated-binary-tree
0905-length-of-longest-fibonacci-subsequence
3227-find-missing-and-repeated-values
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
1460-number-of-substrings-containing-all-three-characters
2308-divide-array-into-equal-pairs
2220-find-all-possible-recipes-from-given-supplies
2888-minimum-index-of-a-valid-split
0768-partition-labels
1218-lowest-common-ancestor-of-deepest-leaves
3656-minimum-number-of-operations-to-make-elements-in-array-distinct
3621-minimum-operations-to-make-array-values-equal-to-k
2626-count-the-number-of-good-subarrays
0797-rabbits-in-forest
1500-count-largest-group
2856-count-complete-subarrays-in-an-array
2915-count-of-interesting-subarrays
1227-number-of-equivalent-domino-pairs
2215-finding-3-digit-even-numbers
3629-total-characters-in-string-after-transformations-i
0073-set-matrix-zeroes
2237-longest-palindrome-by-concatenating-two-letter-words
2520-using-a-robot-to-print-the-lexicographically-smallest-string
3753-maximum-difference-between-even-and-odd-frequency-i
3754-maximum-manhattan-distance-after-k-changes
3360-minimum-deletions-to-make-string-k-special
2204-find-subsequence-of-length-k-with-the-largest-sum
0594-longest-harmonious-subsequence
1510-find-lucky-integer-in-an-array
1995-finding-pairs-with-a-certain-sum
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0202-happy-number
3788-maximum-unique-subarray-sum-after-deletion
0940-fruit-into-baskets
0169-majority-element
0900-reordered-power-of-2
0380-insert-delete-getrandom-o1
0012-integer-to-roman
0049-group-anagrams
0128-longest-consecutive-sequence
0383-ransom-note
0205-isomorphic-strings
0290-word-pattern
0242-valid-anagram
0036-valid-sudoku
1834-minimum-number-of-people-to-teach
3872-find-most-frequent-vowel-and-consonant
1264-maximum-number-of-words-you-can-type
0219-contains-duplicate-ii
2429-design-a-food-rating-system
3678-design-task-manager
3797-design-spreadsheet
3242-count-elements-with-maximum-frequency
0141-linked-list-cycle
0166-fraction-to-recurring-decimal
1612-avoid-flood-in-the-city
1353-find-resultant-array-after-removing-anagrams
2661-smallest-missing-non-negative-integer-after-operations
2174-next-greater-numerically-balanced-number
3581-the-two-sneaky-numbers-of-digitville
3501-delete-nodes-from-linked-list-present-in-array
3610-find-x-sum-of-all-k-long-subarrays-i
2274-keep-multiplying-found-values-by-two
1015-smallest-integer-divisible-by-k
3381-maximum-subarray-sum-with-length-divisible-by-k
3623-count-number-of-trapezoids-i
3625-count-number-of-trapezoids-ii
3583-count-special-triplets
3606-coupon-code-validator
2402-meeting-rooms-iii
0840-magic-squares-in-grid
0961-n-repeated-element-in-size-2n-array
0865-smallest-subtree-with-all-the-deepest-nodes
3507-minimum-pair-removal-to-sort-array-i
0448-find-all-numbers-disappeared-in-an-array

String

0208-implement-trie-prefix-tree
1397-search-suggestions-system
1894-merge-strings-alternately
1146-greatest-common-divisor-of-strings
0712-minimum-ascii-delete-sum-for-two-strings
2599-take-k-of-each-character-from-left-and-right
0345-reverse-vowels-of-a-string
0151-reverse-words-in-a-string
0443-string-compression
0392-is-subsequence
1567-maximum-number-of-vowels-in-a-substring-of-given-length
0003-longest-substring-without-repeating-characters
1777-determine-if-two-strings-are-close
2470-removing-stars-from-a-string
0394-decode-string
0649-dota2-senate
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
2232-adding-spaces-to-a-string
3018-make-string-a-subsequence-using-cyclic-increments
0399-evaluate-division
2414-move-pieces-to-obtain-a-string
3267-find-longest-special-substring-that-occurs-thrice-i
0017-letter-combinations-of-a-phone-number
2300-construct-string-with-repeat-limit
1537-maximum-score-after-splitting-a-string
2691-count-vowel-strings-in-ranges
2465-shifting-letters-ii
2059-unique-length-3-palindromic-subsequences
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1524-string-matching-in-an-array
3309-count-prefix-and-suffix-pairs-i
2292-counting-words-with-a-given-prefix
0952-word-subsets
1502-construct-k-palindrome-strings
2221-check-if-a-parentheses-string-can-be-valid
3455-minimum-length-of-string-after-operations
0067-add-binary
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1915-check-if-one-string-swap-can-make-strings-equal
3447-clear-digits
2021-remove-all-occurrences-of-a-substring
1160-letter-tile-possibilities
2456-construct-smallest-number-from-di-string
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
2107-find-unique-binary-string
1170-shortest-common-supersequence
2463-minimum-recolors-to-get-k-consecutive-black-blocks
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
1460-number-of-substrings-containing-all-three-characters
2220-find-all-possible-recipes-from-given-supplies
0768-partition-labels
3243-count-the-number-of-powerful-integers
0038-count-and-say
0868-push-dominoes
0058-length-of-last-word
3637-count-number-of-balanced-permutations
3629-total-characters-in-string-after-transformations-i
3143-longest-unequal-adjacent-groups-subsequence-i
3194-find-words-containing-character
2237-longest-palindrome-by-concatenating-two-letter-words
3683-find-the-lexicographically-largest-string-from-the-box-i
1058-lexicographically-smallest-equivalent-string
2520-using-a-robot-to-print-the-lexicographically-smallest-string
3753-maximum-difference-between-even-and-odd-frequency-i
3754-maximum-manhattan-distance-after-k-changes
3360-minimum-deletions-to-make-string-k-special
2260-divide-a-string-into-groups-of-size-k
2395-longest-binary-subsequence-less-than-or-equal-to-k
3617-find-the-original-typed-string-i
1350-remove-sub-folders-from-the-filesystem
1302-delete-characters-to-make-fancy-string
1818-maximum-score-from-removing-substrings
2346-largest-3-same-digit-number-in-string
0012-integer-to-roman
0006-zigzag-conversion
0049-group-anagrams
0028-find-the-index-of-the-first-occurrence-in-a-string
0125-valid-palindrome
0383-ransom-note
0205-isomorphic-strings
0290-word-pattern
0242-valid-anagram
2887-sort-vowels-in-a-string
3462-vowels-game-in-a-string
3872-find-most-frequent-vowel-and-consonant
1264-maximum-number-of-words-you-can-type
2429-design-a-food-rating-system
3797-design-spreadsheet
0165-compare-version-numbers
0166-fraction-to-recurring-decimal
1353-find-resultant-array-after-removing-anagrams
2137-final-value-of-variable-after-performing-operations
3768-check-if-digits-are-equal-in-string-after-operations-i
2244-number-of-laser-beams-in-a-bank
1700-minimum-time-to-make-rope-colorful
0474-ones-and-zeroes
3493-maximum-number-of-operations-to-move-ones-to-the-end
3479-count-the-number-of-substrings-with-dominant-ones
1636-number-of-substrings-with-only-1s
2211-count-collisions-on-a-road
3606-coupon-code-validator
2147-number-of-ways-to-divide-a-long-corridor
0944-delete-columns-to-make-sorted
2483-minimum-penalty-for-a-shop

Design

0208-implement-trie-prefix-tree
0969-number-of-recent-calls
2413-smallest-number-in-infinite-set
2434-design-a-number-container-system
1477-product-of-the-last-k-numbers
1387-find-elements-in-a-contaminated-binary-tree
1995-finding-pairs-with-a-certain-sum
0307-range-sum-query-mutable
0380-insert-delete-getrandom-o1
2429-design-a-food-rating-system
3678-design-task-manager
3797-design-spreadsheet

Trie

0208-implement-trie-prefix-tree
1397-search-suggestions-system
3309-count-prefix-and-suffix-pairs-i
0386-lexicographical-numbers
0440-k-th-smallest-in-lexicographical-order
1350-remove-sub-folders-from-the-filesystem

Binary Search

1397-search-suggestions-system
0745-find-smallest-letter-greater-than-target
1046-max-consecutive-ones-iii
0209-minimum-size-subarray-sum
1468-check-if-n-and-its-double-exist
2640-maximum-number-of-integers-to-choose-from-a-range-i
0374-guess-number-higher-or-lower
2392-successful-pairs-of-spells-and-potions
0162-find-peak-element
0907-koko-eating-bananas
1886-minimum-limit-of-balls-in-a-bag
2164-two-best-non-overlapping-events
3427-special-array-ii
0035-search-insert-position
3267-find-longest-special-substring-that-occurs-thrice-i
0222-count-complete-tree-nodes
2891-maximum-beauty-of-an-array-after-applying-operation
0718-maximum-length-of-repeated-subarray
2614-maximum-count-of-positive-integer-and-negative-integer
3643-zero-array-transformation-ii
1335-maximum-candies-allocated-to-k-children
2690-house-robber-iv
2665-minimum-time-to-repair-cars
2280-count-good-triplets-in-an-array
2699-count-the-number-of-fair-pairs
2394-count-subarrays-with-score-less-than-k
2720-minimize-the-maximum-difference-of-pairs
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
2498-smallest-subarrays-with-maximum-bitwise-or
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii
0167-two-sum-ii-input-array-is-sorted
0611-valid-triangle-number
1612-avoid-flood-in-the-city
3622-maximum-frequency-of-an-element-after-performing-operations-i
2141-maximum-running-time-of-n-computers
2054-two-best-non-overlapping-events
1351-count-negative-numbers-in-a-sorted-matrix
3453-separate-squares-i

Sorting

1397-search-suggestions-system
0435-non-overlapping-intervals
0452-minimum-number-of-arrows-to-burst-balloons
1798-max-number-of-k-sum-pairs
0015-3sum
1777-determine-if-two-strings-are-close
1468-check-if-n-and-its-double-exist
0215-kth-largest-element-in-an-array
2636-maximum-subsequence-score
2640-maximum-number-of-integers-to-choose-from-a-range-i
2392-successful-pairs-of-spells-and-potions
2164-two-best-non-overlapping-events
2891-maximum-beauty-of-an-array-after-applying-operation
2695-find-score-of-an-array-after-marking-all-elements
0780-max-chunks-to-make-sorted
3219-make-lexicographically-smallest-array-by-swapping-elements
2473-max-sum-of-a-pair-with-equal-sum-of-digits
3430-count-days-without-meetings
3657-check-if-grid-can-be-cut-into-sections
2160-minimum-operations-to-make-a-uni-value-grid
2888-minimum-index-of-a-valid-split
2588-maximum-number-of-points-from-grid-queries
2681-put-marbles-in-bags
0368-largest-divisible-subset
2699-count-the-number-of-fair-pairs
2215-finding-3-digit-even-numbers
0075-sort-colors
3321-type-of-triangle
3647-zero-array-transformation-iii
3241-divide-array-into-arrays-with-max-difference
2387-partition-array-such-that-maximum-difference-is-k
3360-minimum-deletions-to-make-string-k-special
2204-find-subsequence-of-length-k-with-the-largest-sum
0594-longest-harmonious-subsequence
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
2497-maximum-matching-of-players-with-trainers
0088-merge-sorted-array
0169-majority-element
0047-permutations-ii
0900-reordered-power-of-2
0274-h-index
0049-group-anagrams
3748-sort-matrix-by-diagonals
0242-valid-anagram
2887-sort-vowels-in-a-string
0611-valid-triangle-number
1018-largest-perimeter-triangle
1353-find-resultant-array-after-removing-anagrams
3620-maximum-number-of-distinct-elements-after-operations
3622-maximum-frequency-of-an-element-after-performing-operations-i
2274-keep-multiplying-found-values-by-two
1262-greatest-sum-divisible-by-three
2141-maximum-running-time-of-n-computers
3433-count-mentions-per-user
3606-coupon-code-validator
2054-two-best-non-overlapping-events
3074-apple-redistribution-into-boxes
3075-maximize-happiness-of-selected-children
2402-meeting-rooms-iii
1877-minimize-maximum-pair-sum-in-array
1984-minimum-difference-between-highest-and-lowest-of-k-scores
1200-minimum-absolute-difference
3010-divide-an-array-into-subarrays-with-minimum-cost-i

Heap (Priority Queue)

1397-search-suggestions-system
2375-minimum-obstacle-removal-to-reach-corner
0215-kth-largest-element-in-an-array
2413-smallest-number-in-infinite-set
2636-maximum-subsequence-score
2553-total-cost-to-hire-k-workers
2164-two-best-non-overlapping-events
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
2868-continuous-subarrays
1917-maximum-average-pass-ratio
3555-final-array-state-after-k-multiplication-operations-i
2300-construct-string-with-repeat-limit
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
0407-trapping-rain-water-ii
2434-design-a-number-container-system
2473-max-sum-of-a-pair-with-equal-sum-of-digits
3332-minimum-operations-to-exceed-threshold-value-ii
2588-maximum-number-of-points-from-grid-queries
2681-put-marbles-in-bags
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii
3647-zero-array-transformation-iii
2204-find-subsequence-of-length-k-with-the-largest-sum
2429-design-a-food-rating-system
3678-design-task-manager
1612-avoid-flood-in-the-city
3610-find-x-sum-of-all-k-long-subarrays-i
2054-two-best-non-overlapping-events
2402-meeting-rooms-iii
3507-minimum-pair-removal-to-sort-array-i
3650-minimum-cost-path-with-edge-reversals

Sliding Window

1755-defuse-the-bomb
2552-maximum-sum-of-distinct-subarrays-with-length-k
2599-take-k-of-each-character-from-left-and-right
0643-maximum-average-subarray-i
1567-maximum-number-of-vowels-in-a-substring-of-given-length
1046-max-consecutive-ones-iii
1586-longest-subarray-of-1s-after-deleting-one-element
0003-longest-substring-without-repeating-characters
0209-minimum-size-subarray-sum
3267-find-longest-special-substring-that-occurs-thrice-i
2891-maximum-beauty-of-an-array-after-applying-operation
2868-continuous-subarrays
0718-maximum-length-of-repeated-subarray
2463-minimum-recolors-to-get-k-consecutive-black-blocks
3483-alternating-groups-ii
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
1460-number-of-substrings-containing-all-three-characters
2478-longest-nice-subarray
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
2626-count-the-number-of-good-subarrays
2856-count-complete-subarrays-in-an-array
2527-count-subarrays-with-fixed-bounds
2394-count-subarrays-with-score-less-than-k
3213-count-subarrays-where-max-element-appears-at-least-k-times
0594-longest-harmonious-subsequence
3743-reschedule-meetings-for-maximum-free-time-i
2498-smallest-subarrays-with-maximum-bitwise-or
0940-fruit-into-baskets
0867-new-21-game
0219-contains-duplicate-ii
3622-maximum-frequency-of-an-element-after-performing-operations-i
3610-find-x-sum-of-all-k-long-subarrays-i
3479-count-the-number-of-substrings-with-dominant-ones
1984-minimum-difference-between-highest-and-lowest-of-k-scores

Greedy

0435-non-overlapping-intervals
0452-minimum-number-of-arrows-to-burst-balloons
0605-can-place-flowers
0334-increasing-triplet-subsequence
0011-container-with-most-water
0649-dota2-senate
2636-maximum-subsequence-score
2640-maximum-number-of-integers-to-choose-from-a-range-i
1917-maximum-average-pass-ratio
2300-construct-string-with-repeat-limit
0780-max-chunks-to-make-sorted
1502-construct-k-palindrome-strings
2221-check-if-a-parentheses-string-can-be-valid
2509-minimize-xor
2456-construct-smallest-number-from-di-string
0768-partition-labels
2681-put-marbles-in-bags
0797-rabbits-in-forest
1049-minimum-domino-rotations-for-equal-row
3171-minimum-equal-sum-of-two-arrays-after-replacing-zeros
3143-longest-unequal-adjacent-groups-subsequence-i
3647-zero-array-transformation-iii
2237-longest-palindrome-by-concatenating-two-letter-words
0135-candy
2520-using-a-robot-to-print-the-lexicographically-smallest-string
2720-minimize-the-maximum-difference-of-pairs
2704-maximum-difference-by-remapping-a-digit
1529-max-difference-you-can-get-from-changing-an-integer
3241-divide-array-into-arrays-with-max-difference
2387-partition-array-such-that-maximum-difference-is-k
3360-minimum-deletions-to-make-string-k-special
2395-longest-binary-subsequence-less-than-or-equal-to-k
0670-maximum-swap
3743-reschedule-meetings-for-maximum-free-time-i
2497-maximum-matching-of-players-with-trainers
1818-maximum-score-from-removing-substrings
3788-maximum-unique-subarray-sum-after-deletion
0122-best-time-to-buy-and-sell-stock-ii
0055-jump-game
0134-gas-station
1448-maximum-69-number
1834-minimum-number-of-people-to-teach
0611-valid-triangle-number
1018-largest-perimeter-triangle
1612-avoid-flood-in-the-city
2661-smallest-missing-non-negative-integer-after-operations
3620-maximum-number-of-distinct-elements-after-operations
1633-minimum-number-of-increments-on-subarrays-to-form-a-target-array
1700-minimum-time-to-make-rope-colorful
3493-maximum-number-of-operations-to-move-ones-to-the-end
1262-greatest-sum-divisible-by-three
2141-maximum-running-time-of-n-computers
3074-apple-redistribution-into-boxes
3075-maximize-happiness-of-selected-children
1975-maximum-matrix-sum
1877-minimize-maximum-pair-sum-in-array

Two Pointers

1894-merge-strings-alternately
0345-reverse-vowels-of-a-string
0151-reverse-words-in-a-string
0443-string-compression
0283-move-zeroes
0392-is-subsequence
1972-rotating-the-box
0011-container-with-most-water
1798-max-number-of-k-sum-pairs
0015-3sum
1468-check-if-n-and-its-double-exist
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
2216-delete-the-middle-node-of-a-linked-list
2236-maximum-twin-sum-of-a-linked-list
2232-adding-spaces-to-a-string
3018-make-string-a-subsequence-using-cyclic-increments
2414-move-pieces-to-obtain-a-string
2553-total-cost-to-hire-k-workers
2392-successful-pairs-of-spells-and-potions
2551-apply-operations-to-an-array
2265-partition-array-according-to-given-pivot
0026-remove-duplicates-from-sorted-array
2588-maximum-number-of-points-from-grid-queries
0768-partition-labels
2699-count-the-number-of-fair-pairs
0868-push-dominoes
0075-sort-colors
3683-find-the-lexicographically-largest-string-from-the-box-i
2320-find-all-k-distant-indices-in-an-array
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
2497-maximum-matching-of-players-with-trainers
0027-remove-element
0202-happy-number
0088-merge-sorted-array
0080-remove-duplicates-from-sorted-array-ii
0189-rotate-array
0167-two-sum-ii-input-array-is-sorted
0028-find-the-index-of-the-first-occurrence-in-a-string
0125-valid-palindrome
0165-compare-version-numbers
0141-linked-list-cycle
0611-valid-triangle-number
1877-minimize-maximum-pair-sum-in-array

Math

1146-greatest-common-divisor-of-strings
0870-magic-squares-in-grid
0007-reverse-integer
3555-final-array-state-after-k-multiplication-operations-i
0002-add-two-numbers
0067-add-binary
2448-count-number-of-bad-pairs
0258-add-digits
1477-product-of-the-last-k-numbers
2802-find-the-punishment-number-of-an-integer
1631-number-of-sub-arrays-with-odd-sum
1889-check-if-number-is-a-sum-of-powers-of-three
2649-count-total-number-of-colored-cells
3227-find-missing-and-repeated-values
2610-closest-prime-numbers-in-range
2160-minimum-operations-to-make-a-uni-value-grid
2351-number-of-ways-to-buy-pens-and-pencils
1993-sum-of-all-subset-xor-totals
0368-largest-divisible-subset
3243-count-the-number-of-powerful-integers
2998-count-symmetric-integers
0050-powx-n
2050-count-good-numbers
0797-rabbits-in-forest
2415-count-the-number-of-ideal-arrays
1500-count-largest-group
1421-find-numbers-with-even-number-of-digits
3637-count-number-of-balanced-permutations
3629-total-characters-in-string-after-transformations-i
3321-type-of-triangle
3172-divisible-and-non-divisible-sums-difference
3201-distribute-candies-among-children-ii
2704-maximum-difference-by-remapping-a-digit
1529-max-difference-you-can-get-from-changing-an-integer
3754-maximum-manhattan-distance-after-k-changes
0670-maximum-swap
3600-find-the-k-th-character-in-string-game-i
3601-find-the-k-th-character-in-string-game-ii
1411-convert-binary-number-in-a-linked-list-to-integer
0202-happy-number
0371-sum-of-two-integers
0189-rotate-array
0826-soup-servings
0231-power-of-two
0326-power-of-three
0900-reordered-power-of-2
0342-power-of-four
0380-insert-delete-getrandom-o1
1448-maximum-69-number
0867-new-21-game
2432-number-of-zero-filled-subarrays
0012-integer-to-roman
3279-alice-and-bob-playing-flower-game
3830-find-closest-person
1426-find-n-unique-integers-sum-up-to-zero
1440-convert-integer-to-the-sum-of-two-no-zero-integers
0048-rotate-image
3462-vowels-game-in-a-string
2307-replace-non-coprime-numbers-in-array
0166-fraction-to-recurring-decimal
0830-largest-triangle-area
1018-largest-perimeter-triangle
2324-find-triangular-sum-of-an-array
1642-water-bottles
3336-water-bottles-ii
2661-smallest-missing-non-negative-integer-after-operations
3768-check-if-digits-are-equal-in-string-after-operations-i
2174-next-greater-numerically-balanced-number
1817-calculate-money-in-leetcode-bank
2244-number-of-laser-beams-in-a-bank
3676-smallest-number-with-all-set-bits
3581-the-two-sneaky-numbers-of-digitville
2288-count-operations-to-obtain-zero
2753-minimum-number-of-operations-to-make-all-array-elements-equal-to-1
1636-number-of-substrings-with-only-1s
3190-find-minimum-operations-to-make-all-elements-divisible-by-three
1015-smallest-integer-divisible-by-k
1317-convert-integer-to-the-sum-of-two-no-zero-integers
3512-minimum-operations-to-make-array-sum-divisible-by-k
3623-count-number-of-trapezoids-i
3625-count-number-of-trapezoids-ii
3432-count-partitions-with-even-sum-difference
1523-count-odd-numbers-in-an-interval-range
1925-count-square-sum-triples
3577-count-the-number-of-computer-unlocking-permutations
3433-count-mentions-per-user
2147-number-of-ways-to-divide-a-long-corridor
2110-number-of-smooth-descent-periods-of-a-stock
0840-magic-squares-in-grid
0066-plus-one
1390-four-divisors
1266-minimum-time-visiting-all-points

Breadth-First Search

1036-rotting-oranges
0787-sliding-puzzle
3517-shortest-distance-after-road-addition-queries-i
2375-minimum-obstacle-removal-to-reach-corner
0104-maximum-depth-of-binary-tree
1544-count-good-nodes-in-binary-tree
0199-binary-tree-right-side-view
1116-maximum-level-sum-of-a-binary-tree
0871-keys-and-rooms
0547-number-of-provinces
1576-reorder-routes-to-make-all-paths-lead-to-the-city-zero
0399-evaluate-division
2038-nearest-exit-from-entrance-in-maze
2493-reverse-odd-levels-of-binary-tree
0515-find-largest-value-in-each-tree-row
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
3439-find-minimum-diameter-after-merging-two-trees
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1876-map-of-highest-peak
0407-trapping-rain-water-ii
1396-count-servers-that-communicate
0820-find-eventual-safe-states
2764-maximum-number-of-fish-in-a-grid
1558-course-schedule-iv
0684-redundant-connection
2583-divide-nodes-into-the-maximum-number-of-groups
0854-making-a-large-island
1387-find-elements-in-a-contaminated-binary-tree
2564-most-profitable-path-in-a-tree
2588-maximum-number-of-points-from-grid-queries
1218-lowest-common-ancestor-of-deepest-leaves
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii
0945-snakes-and-ladders
1424-maximum-candies-you-can-get-from-boxes
0417-pacific-atlantic-water-flow
1161-maximum-level-sum-of-a-binary-tree
0865-smallest-subtree-with-all-the-deepest-nodes

Matrix

1036-rotting-oranges
0870-magic-squares-in-grid
2343-count-unguarded-cells-in-the-grid
1147-flip-columns-for-maximum-number-of-equal-rows
1972-rotating-the-box
0787-sliding-puzzle
2428-equal-row-and-column-pairs
2375-minimum-obstacle-removal-to-reach-corner
2038-nearest-exit-from-entrance-in-maze
2685-first-completely-painted-row-or-column
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2145-grid-game
1876-map-of-highest-peak
0407-trapping-rain-water-ii
1396-count-servers-that-communicate
2764-maximum-number-of-fish-in-a-grid
0854-making-a-large-island
3227-find-missing-and-repeated-values
2160-minimum-operations-to-make-a-uni-value-grid
1402-count-square-submatrices-with-all-ones
2588-maximum-number-of-points-from-grid-queries
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii
0073-set-matrix-zeroes
0945-snakes-and-ladders
1628-count-submatrices-with-all-ones
3461-find-the-minimum-area-to-cover-all-ones-i
0498-diagonal-traverse
3748-sort-matrix-by-diagonals
0036-valid-sudoku
0054-spiral-matrix
0048-rotate-image
0289-game-of-life
3797-design-spreadsheet
0417-pacific-atlantic-water-flow
2244-number-of-laser-beams-in-a-bank
2625-increment-submatrices-by-one
2435-paths-in-matrix-whose-sum-is-divisible-by-k
1351-count-negative-numbers-in-a-sorted-matrix
0840-magic-squares-in-grid
1975-maximum-matrix-sum

Stack

0739-daily-temperatures
2470-removing-stars-from-a-string
0735-asteroid-collision
0394-decode-string
2236-maximum-twin-sum-of-a-linked-list
0094-binary-tree-inorder-traversal
1570-final-prices-with-a-special-discount-in-a-shop
0780-max-chunks-to-make-sorted
2221-check-if-a-parentheses-string-can-be-valid
3447-clear-digits
2021-remove-all-occurrences-of-a-substring
2456-construct-smallest-number-from-di-string
2520-using-a-robot-to-print-the-lexicographically-smallest-string
1818-maximum-score-from-removing-substrings
1628-count-submatrices-with-all-ones
2307-replace-non-coprime-numbers-in-array
1633-minimum-number-of-increments-on-subarrays-to-form-a-target-array
2211-count-collisions-on-a-road

Monotonic Stack

0739-daily-temperatures
1570-final-prices-with-a-special-discount-in-a-shop
0780-max-chunks-to-make-sorted
1628-count-submatrices-with-all-ones
1633-minimum-number-of-increments-on-subarrays-to-form-a-target-array

Simulation

2343-count-unguarded-cells-in-the-grid
2428-equal-row-and-column-pairs
2470-removing-stars-from-a-string
0735-asteroid-collision
2232-adding-spaces-to-a-string
2553-total-cost-to-hire-k-workers
3651-transformed-array
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
3555-final-array-state-after-k-multiplication-operations-i
0067-add-binary
3434-find-the-number-of-distinct-colors-among-the-balls
3447-clear-digits
2021-remove-all-occurrences-of-a-substring
0258-add-digits
3332-minimum-operations-to-exceed-threshold-value-ii
2551-apply-operations-to-an-array
2265-partition-array-according-to-given-pivot
2048-build-array-from-permutation
2260-divide-a-string-into-groups-of-size-k
3600-find-the-k-th-character-in-string-game-i
3790-fruits-into-baskets-ii
0498-diagonal-traverse
0054-spiral-matrix
2408-number-of-people-aware-of-a-secret
0289-game-of-life
2324-find-triangular-sum-of-an-array
1642-water-bottles
3336-water-bottles-ii
3794-find-the-minimum-amount-of-time-to-brew-potions
2137-final-value-of-variable-after-performing-operations
3768-check-if-digits-are-equal-in-string-after-operations-i
3616-make-array-elements-equal-to-zero
2288-count-operations-to-obtain-zero
2274-keep-multiplying-found-values-by-two
2211-count-collisions-on-a-road
3433-count-mentions-per-user
2402-meeting-rooms-iii
1929-concatenation-of-array
3507-minimum-pair-removal-to-sort-array-i

Prefix Sum

0238-product-of-array-except-self
1046-max-consecutive-ones-iii
1833-find-the-highest-altitude
0724-find-pivot-index
0209-minimum-size-subarray-sum
3427-special-array-ii
1537-maximum-score-after-splitting-a-string
2691-count-vowel-strings-in-ranges
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
2059-unique-length-3-palindromic-subsequences
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2145-grid-game
1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
3643-zero-array-transformation-ii
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
2249-count-the-hidden-sequences
2915-count-of-interesting-subarrays
2394-count-subarrays-with-score-less-than-k
3639-zero-array-transformation-i
3647-zero-array-transformation-iii
2529-range-product-queries-of-powers
3794-find-the-minimum-amount-of-time-to-brew-potions
3383-taking-maximum-energy-from-the-mystic-dungeon
3622-maximum-frequency-of-an-element-after-performing-operations-i
3616-make-array-elements-equal-to-zero
2625-increment-submatrices-by-one
3381-maximum-subarray-sum-with-length-divisible-by-k
3432-count-partitions-with-even-sum-difference
2483-minimum-penalty-for-a-shop

Graph

3189-find-champion-ii
3517-shortest-distance-after-road-addition-queries-i
2375-minimum-obstacle-removal-to-reach-corner
0871-keys-and-rooms
0547-number-of-provinces
1576-reorder-routes-to-make-all-paths-lead-to-the-city-zero
0399-evaluate-division
3439-find-minimum-diameter-after-merging-two-trees
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
0820-find-eventual-safe-states
1558-course-schedule-iv
0684-redundant-connection
2246-maximum-employees-to-be-invited-to-a-meeting
2583-divide-nodes-into-the-maximum-number-of-groups
2564-most-profitable-path-in-a-tree
3348-minimum-cost-walk-in-weighted-graph
2220-find-all-possible-recipes-from-given-supplies
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii
2438-find-closest-node-to-given-two-nodes
1424-maximum-candies-you-can-get-from-boxes

Counting

1777-determine-if-two-strings-are-close
3267-find-longest-special-substring-that-occurs-thrice-i
2300-construct-string-with-repeat-limit
1502-construct-k-palindrome-strings
3455-minimum-length-of-string-after-operations
1396-count-servers-that-communicate
1915-check-if-one-string-swap-can-make-strings-equal
1364-tuple-with-same-product
2448-count-number-of-bad-pairs
1160-letter-tile-possibilities
2614-maximum-count-of-positive-integer-and-negative-integer
2308-divide-array-into-equal-pairs
1227-number-of-equivalent-domino-pairs
3629-total-characters-in-string-after-transformations-i
2237-longest-palindrome-by-concatenating-two-letter-words
3753-maximum-difference-between-even-and-odd-frequency-i
3754-maximum-manhattan-distance-after-k-changes
3360-minimum-deletions-to-make-string-k-special
0594-longest-harmonious-subsequence
1510-find-lucky-integer-in-an-array
0169-majority-element
0900-reordered-power-of-2
0383-ransom-note
3872-find-most-frequent-vowel-and-consonant
3242-count-elements-with-maximum-frequency
2174-next-greater-numerically-balanced-number
3493-maximum-number-of-operations-to-move-ones-to-the-end
3583-count-special-triplets

Shortest Path

2375-minimum-obstacle-removal-to-reach-corner
0399-evaluate-division
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii
3650-minimum-cost-path-with-edge-reversals

Recursion

0394-decode-string
0206-reverse-linked-list
0002-add-two-numbers
0050-powx-n
2050-count-good-numbers
3600-find-the-k-th-character-in-string-game-i
3601-find-the-k-th-character-in-string-game-ii
0231-power-of-two
0326-power-of-three
0342-power-of-four

Queue

0969-number-of-recent-calls
0649-dota2-senate
2868-continuous-subarrays
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
2527-count-subarrays-with-fixed-bounds
2408-number-of-people-aware-of-a-secret

Data Stream

0969-number-of-recent-calls
1477-product-of-the-last-k-numbers

String Matching

1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1524-string-matching-in-an-array
3309-count-prefix-and-suffix-pairs-i
2292-counting-words-with-a-given-prefix
0028-find-the-index-of-the-first-occurrence-in-a-string

Linked List

2216-delete-the-middle-node-of-a-linked-list
0328-odd-even-linked-list
0206-reverse-linked-list
2236-maximum-twin-sum-of-a-linked-list
0002-add-two-numbers
1411-convert-binary-number-in-a-linked-list-to-integer
0141-linked-list-cycle
3501-delete-nodes-from-linked-list-present-in-array
3507-minimum-pair-removal-to-sort-array-i

Tree

0104-maximum-depth-of-binary-tree
0904-leaf-similar-trees
1544-count-good-nodes-in-binary-tree
0437-path-sum-iii
1474-longest-zigzag-path-in-a-binary-tree
0236-lowest-common-ancestor-of-a-binary-tree
0199-binary-tree-right-side-view
1116-maximum-level-sum-of-a-binary-tree
0783-search-in-a-binary-search-tree
0450-delete-node-in-a-bst
0094-binary-tree-inorder-traversal
0222-count-complete-tree-nodes
2493-reverse-odd-levels-of-binary-tree
0515-find-largest-value-in-each-tree-row
3058-maximum-number-of-k-divisible-components
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
3439-find-minimum-diameter-after-merging-two-trees
1387-find-elements-in-a-contaminated-binary-tree
2564-most-profitable-path-in-a-tree
1218-lowest-common-ancestor-of-deepest-leaves
0543-diameter-of-binary-tree
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii
0106-construct-binary-tree-from-inorder-and-postorder-traversal
2872-maximum-number-of-k-divisible-components
1161-maximum-level-sum-of-a-binary-tree
1339-maximum-product-of-splitted-binary-tree
0865-smallest-subtree-with-all-the-deepest-nodes

Depth-First Search

0104-maximum-depth-of-binary-tree
0904-leaf-similar-trees
1544-count-good-nodes-in-binary-tree
0437-path-sum-iii
1474-longest-zigzag-path-in-a-binary-tree
0236-lowest-common-ancestor-of-a-binary-tree
0199-binary-tree-right-side-view
1116-maximum-level-sum-of-a-binary-tree
0094-binary-tree-inorder-traversal
0871-keys-and-rooms
0547-number-of-provinces
1576-reorder-routes-to-make-all-paths-lead-to-the-city-zero
0399-evaluate-division
2493-reverse-odd-levels-of-binary-tree
0515-find-largest-value-in-each-tree-row
3058-maximum-number-of-k-divisible-components
3439-find-minimum-diameter-after-merging-two-trees
1396-count-servers-that-communicate
0820-find-eventual-safe-states
2764-maximum-number-of-fish-in-a-grid
1558-course-schedule-iv
0684-redundant-connection
2246-maximum-employees-to-be-invited-to-a-meeting
2583-divide-nodes-into-the-maximum-number-of-groups
0854-making-a-large-island
1387-find-elements-in-a-contaminated-binary-tree
2564-most-profitable-path-in-a-tree
1218-lowest-common-ancestor-of-deepest-leaves
0543-diameter-of-binary-tree
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii
2438-find-closest-node-to-given-two-nodes
0386-lexicographical-numbers
1350-remove-sub-folders-from-the-filesystem
0417-pacific-atlantic-water-flow
2872-maximum-number-of-k-divisible-components
1161-maximum-level-sum-of-a-binary-tree
1339-maximum-product-of-splitted-binary-tree
0865-smallest-subtree-with-all-the-deepest-nodes

Binary Tree

0104-maximum-depth-of-binary-tree
0904-leaf-similar-trees
1544-count-good-nodes-in-binary-tree
0437-path-sum-iii
1474-longest-zigzag-path-in-a-binary-tree
0236-lowest-common-ancestor-of-a-binary-tree
0199-binary-tree-right-side-view
1116-maximum-level-sum-of-a-binary-tree
0783-search-in-a-binary-search-tree
0450-delete-node-in-a-bst
0094-binary-tree-inorder-traversal
0222-count-complete-tree-nodes
2493-reverse-odd-levels-of-binary-tree
0515-find-largest-value-in-each-tree-row
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
1387-find-elements-in-a-contaminated-binary-tree
1218-lowest-common-ancestor-of-deepest-leaves
0543-diameter-of-binary-tree
0106-construct-binary-tree-from-inorder-and-postorder-traversal
1161-maximum-level-sum-of-a-binary-tree
1339-maximum-product-of-splitted-binary-tree
0865-smallest-subtree-with-all-the-deepest-nodes

Binary Search Tree

0783-search-in-a-binary-search-tree
0450-delete-node-in-a-bst

Union Find

0547-number-of-provinces
0399-evaluate-division
1396-count-servers-that-communicate
2764-maximum-number-of-fish-in-a-grid
3219-make-lexicographically-smallest-array-by-swapping-elements
0684-redundant-connection
2583-divide-nodes-into-the-maximum-number-of-groups
0854-making-a-large-island
3348-minimum-cost-walk-in-weighted-graph
2588-maximum-number-of-points-from-grid-queries
1058-lexicographically-smallest-equivalent-string
0128-longest-consecutive-sequence

Divide and Conquer

0215-kth-largest-element-in-an-array
2280-count-good-triplets-in-an-array
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0169-majority-element

Quickselect

0215-kth-largest-element-in-an-array

Ordered Set

2413-smallest-number-in-infinite-set
2868-continuous-subarrays
2434-design-a-number-container-system
2280-count-good-triplets-in-an-array
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii
2429-design-a-food-rating-system
3678-design-task-manager
3507-minimum-pair-removal-to-sort-array-i

Interactive

0374-guess-number-higher-or-lower

Backtracking

0017-letter-combinations-of-a-phone-number
0216-combination-sum-iii
0494-target-sum
2802-find-the-punishment-number-of-an-integer
1160-letter-tile-possibilities
2456-construct-smallest-number-from-di-string
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
2107-find-unique-binary-string
1819-construct-the-lexicographically-largest-valid-sequence
1993-sum-of-all-subset-xor-totals
2170-count-number-of-maximum-bitwise-or-subsets
0047-permutations-ii
2174-next-greater-numerically-balanced-number

Monotonic Queue

2868-continuous-subarrays
2527-count-subarrays-with-fixed-bounds

Rolling Hash

0718-maximum-length-of-repeated-subarray
3309-count-prefix-and-suffix-pairs-i

Hash Function

0718-maximum-length-of-repeated-subarray
3309-count-prefix-and-suffix-pairs-i

Brainteaser

2533-bitwise-xor-of-all-pairings
2503-longest-subarray-with-maximum-bitwise-and
2837-minimum-operations-to-make-the-integer-zero
3462-vowels-game-in-a-string
3577-count-the-number-of-computer-unlocking-permutations

Topological Sort

0820-find-eventual-safe-states
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting
2220-find-all-possible-recipes-from-given-supplies

Number Theory

0258-add-digits
2610-closest-prime-numbers-in-range
2415-count-the-number-of-ideal-arrays
2307-replace-non-coprime-numbers-in-array
3768-check-if-digits-are-equal-in-string-after-operations-i
2753-minimum-number-of-operations-to-make-all-array-elements-equal-to-1

Enumeration

2351-number-of-ways-to-buy-pens-and-pencils
1993-sum-of-all-subset-xor-totals
2998-count-symmetric-integers
1656-count-good-triplets
2215-finding-3-digit-even-numbers
3201-distribute-candies-among-children-ii
3683-find-the-lexicographically-largest-string-from-the-box-i
2170-count-number-of-maximum-bitwise-or-subsets
0900-reordered-power-of-2
2837-minimum-operations-to-make-the-integer-zero
2174-next-greater-numerically-balanced-number
3479-count-the-number-of-substrings-with-dominant-ones
1925-count-square-sum-triples
3010-divide-an-array-into-subarrays-with-minimum-cost-i

Combinatorics

1993-sum-of-all-subset-xor-totals
2415-count-the-number-of-ideal-arrays
3637-count-number-of-balanced-permutations
3201-distribute-candies-among-children-ii
2324-find-triangular-sum-of-an-array
3768-check-if-digits-are-equal-in-string-after-operations-i
3577-count-the-number-of-computer-unlocking-permutations

Binary Indexed Tree

2280-count-good-triplets-in-an-array
0307-range-sum-query-mutable

Segment Tree

2280-count-good-triplets-in-an-array
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii
0307-range-sum-query-mutable

Merge Sort

2280-count-good-triplets-in-an-array

Memoization

2395-longest-binary-subsequence-less-than-or-equal-to-k
1732-minimum-one-bit-operations-to-make-integers-zero

Probability and Statistics

0826-soup-servings
0867-new-21-game

Counting Sort

0274-h-index

Randomized

0380-insert-delete-getrandom-o1

Game Theory

3462-vowels-game-in-a-string

Geometry

0830-largest-triangle-area
3623-count-number-of-trapezoids-i
3625-count-number-of-trapezoids-ii
1266-minimum-time-visiting-all-points

Database

0175-combine-two-tables
0181-employees-earning-more-than-their-managers
0620-not-boring-movies
0584-find-customer-referee
0586-customer-placing-the-largest-number-of-orders
0596-classes-with-at-least-5-students
1245-user-activity-for-the-past-30-days-i
1317-monthly-transactions-i
1415-students-and-examinations
1135-customers-who-bought-all-products
0608-tree-node
1480-movie-rating
0178-rank-scores
0262-trips-and-users
0180-consecutive-numbers
0585-investments-in-2016
0184-department-highest-salary
1070-product-sales-analysis-iii

Doubly-Linked List

3507-minimum-pair-removal-to-sort-array-i

Graph Theory

3650-minimum-cost-path-with-edge-reversals

About

A collection of LeetCode questions to ace the coding interview! - Created using [LeetHub v2](https://github.com/arunbhardwaj/LeetHub-2.0)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages