Skip to content

A collection of LeetCode questions to ace the coding interview!

License

Notifications You must be signed in to change notification settings

themysterysolver/LEET-AND-FUN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LEET-AND-FUN

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

LeetCode Topics

Math

0002-add-two-numbers
0007-reverse-integer
0009-palindrome-number
0012-integer-to-roman
0013-roman-to-integer
0029-divide-two-integers
0048-rotate-image
0062-unique-paths
0066-plus-one
0069-sqrtx
0070-climbing-stairs
0150-evaluate-reverse-polish-notation
0168-excel-sheet-column-title
0171-excel-sheet-column-number
0172-factorial-trailing-zeroes
0189-rotate-array
0204-count-primes
0223-rectangle-area
0227-basic-calculator-ii
0231-power-of-two
0258-add-digits
0263-ugly-number
0268-missing-number
0292-nim-game
0326-power-of-three
0342-power-of-four
0367-valid-perfect-square
0382-linked-list-random-node
0412-fizz-buzz
0441-arranging-coins
0445-add-two-numbers-ii
0504-base-7
0507-perfect-number
0539-minimum-time-difference
0593-valid-square
0650-2-keys-keyboard
0670-maximum-swap
0915-generate-random-point-in-a-circle
1013-fibonacci-number
1033-broken-calculator
1146-greatest-common-divisor-of-strings
1236-n-th-tribonacci-number
1349-check-if-it-is-a-straight-line
1446-angle-between-hands-of-a-clock
1889-check-if-number-is-a-sum-of-powers-of-three
2083-three-divisors
2106-find-greatest-common-divisor-of-array
2206-detonate-the-maximum-bombs
2278-find-three-consecutive-integers-that-sum-to-a-given-number
2284-smallest-value-of-the-rearranged-number
2383-add-two-integers
2481-strictly-palindromic-number
2491-smallest-even-multiple
2575-minimum-cuts-to-divide-a-circle
2680-count-collisions-of-monkeys-on-a-polygon
2752-sum-multiples
2824-check-if-the-number-is-fascinating
2857-total-distance-traveled
3227-find-missing-and-repeated-values
3371-harshad-number
3555-final-array-state-after-k-multiplication-operations-i

Greedy

0011-container-with-most-water
0045-jump-game-ii
0055-jump-game
0135-candy
0179-largest-number
0334-increasing-triplet-subsequence
0435-non-overlapping-intervals
0452-minimum-number-of-arrows-to-burst-balloons
0605-can-place-flowers
0624-maximum-distance-in-arrays
0670-maximum-swap
0680-valid-palindrome-ii
0778-reorganize-string
0780-max-chunks-to-make-sorted
0876-hand-of-straights
0890-lemonade-change
0917-boats-to-save-people
0957-minimum-add-to-make-parentheses-valid
1033-broken-calculator
1304-longest-happy-string
1422-divide-array-in-sets-of-k-consecutive-numbers
1766-minimum-number-of-removals-to-make-mountain-array
1917-maximum-average-pass-ratio
1988-minimize-maximum-pair-sum-in-array
2089-maximum-matrix-sum
2094-remove-stones-to-minimize-the-total
2095-minimum-number-of-swaps-to-make-the-string-balanced
2300-construct-string-with-repeat-limit
2345-minimum-number-of-operations-to-convert-time
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
2640-maximum-number-of-integers-to-choose-from-a-range-i
3195-separate-black-and-white-balls

Linked List

0002-add-two-numbers
0019-remove-nth-node-from-end-of-list
0021-merge-two-sorted-lists
0023-merge-k-sorted-lists
0024-swap-nodes-in-pairs
0061-rotate-list
0082-remove-duplicates-from-sorted-list-ii
0083-remove-duplicates-from-sorted-list
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0117-populating-next-right-pointers-in-each-node-ii
0138-copy-list-with-random-pointer
0141-linked-list-cycle
0142-linked-list-cycle-ii
0147-insertion-sort-list
0160-intersection-of-two-linked-lists
0206-reverse-linked-list
0234-palindrome-linked-list
0237-delete-node-in-a-linked-list
0328-odd-even-linked-list
0382-linked-list-random-node
0445-add-two-numbers-ii
0528-swapping-nodes-in-a-linked-list
0908-middle-of-the-linked-list
1072-next-greater-node-in-linked-list
2216-delete-the-middle-node-of-a-linked-list
2236-maximum-twin-sum-of-a-linked-list

Stack

0020-valid-parentheses
0042-trapping-rain-water
0071-simplify-path
0094-binary-tree-inorder-traversal
0114-flatten-binary-tree-to-linked-list
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0150-evaluate-reverse-polish-notation
0155-min-stack
0225-implement-stack-using-queues
0227-basic-calculator-ii
0232-implement-queue-using-stacks
0234-palindrome-linked-list
0394-decode-string
0445-add-two-numbers-ii
0496-next-greater-element-i
0735-asteroid-collision
0739-daily-temperatures
0780-max-chunks-to-make-sorted
0957-minimum-add-to-make-parentheses-valid
0983-validate-stack-sequences
1002-maximum-width-ramp
1072-next-greater-node-in-linked-list
1197-parsing-a-boolean-expression
1371-minimum-remove-to-make-valid-parentheses
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1720-crawler-log-folder
2095-minimum-number-of-swaps-to-make-the-string-balanced
2236-maximum-twin-sum-of-a-linked-list
2470-removing-stars-from-a-string
3181-find-building-where-alice-and-bob-can-meet

Recursion

0002-add-two-numbers
0010-regular-expression-matching
0021-merge-two-sorted-lists
0024-swap-nodes-in-pairs
0206-reverse-linked-list
0231-power-of-two
0234-palindrome-linked-list
0326-power-of-three
0342-power-of-four
0394-decode-string
1013-fibonacci-number
1197-parsing-a-boolean-expression
1667-find-kth-bit-in-nth-binary-string
2680-count-collisions-of-monkeys-on-a-polygon

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0011-container-with-most-water
0015-3sum
0018-4sum
0026-remove-duplicates-from-sorted-array
0027-remove-element
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0036-valid-sudoku
0041-first-missing-positive
0042-trapping-rain-water
0045-jump-game-ii
0046-permutations
0047-permutations-ii
0048-rotate-image
0049-group-anagrams
0051-n-queens
0053-maximum-subarray
0054-spiral-matrix
0055-jump-game
0056-merge-intervals
0059-spiral-matrix-ii
0063-unique-paths-ii
0064-minimum-path-sum
0066-plus-one
0068-text-justification
0073-set-matrix-zeroes
0074-search-a-2d-matrix
0075-sort-colors
0078-subsets
0090-subsets-ii
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0118-pascals-triangle
0120-triangle
0121-best-time-to-buy-and-sell-stock
0128-longest-consecutive-sequence
0130-surrounded-regions
0135-candy
0136-single-number
0150-evaluate-reverse-polish-notation
0152-maximum-product-subarray
0153-find-minimum-in-rotated-sorted-array
0162-find-peak-element
0164-maximum-gap
0167-two-sum-ii-input-array-is-sorted
0169-majority-element
0179-largest-number
0189-rotate-array
0198-house-robber
0200-number-of-islands
0204-count-primes
0209-minimum-size-subarray-sum
0213-house-robber-ii
0215-kth-largest-element-in-an-array
0217-contains-duplicate
0219-contains-duplicate-ii
0238-product-of-array-except-self
0260-single-number-iii
0268-missing-number
0275-h-index-ii
0283-move-zeroes
0287-find-the-duplicate-number
0289-game-of-life
0300-longest-increasing-subsequence
0322-coin-change
0334-increasing-triplet-subsequence
0347-top-k-frequent-elements
0414-third-maximum-number
0419-battleships-in-a-board
0435-non-overlapping-intervals
0442-find-all-duplicates-in-an-array
0448-find-all-numbers-disappeared-in-an-array
0452-minimum-number-of-arrows-to-burst-balloons
0463-island-perimeter
0485-max-consecutive-ones
0494-target-sum
0496-next-greater-element-i
0498-diagonal-traverse
0529-minesweeper
0539-minimum-time-difference
0540-single-element-in-a-sorted-array
0542-01-matrix
0554-brick-wall
0560-subarray-sum-equals-k
0605-can-place-flowers
0624-maximum-distance-in-arrays
0643-maximum-average-subarray-i
0645-set-mismatch
0689-maximum-sum-of-3-non-overlapping-subarrays
0695-max-area-of-island
0724-find-pivot-index
0729-my-calendar-i
0733-flood-fill
0735-asteroid-collision
0739-daily-temperatures
0747-min-cost-climbing-stairs
0780-max-chunks-to-make-sorted
0787-sliding-puzzle
0792-binary-search
0876-hand-of-straights
0878-shifting-letters
0882-peak-index-in-a-mountain-array
0890-lemonade-change
0892-shortest-subarray-with-sum-at-least-k
0898-transpose-matrix
0906-walking-robot-simulation
0917-boats-to-save-people
0932-monotonic-array
0948-sort-an-array
0967-minimum-falling-path-sum
0978-valid-mountain-array
0983-validate-stack-sequences
0999-regions-cut-by-slashes
1002-maximum-width-ramp
1025-minimum-cost-for-tickets
1036-rotting-oranges
1039-find-the-town-judge
1041-available-captures-for-rook
1046-max-consecutive-ones-iii
1072-next-greater-node-in-linked-list
1073-number-of-enclaves
1104-coloring-a-border
1127-last-stone-weight
1137-height-checker
1147-flip-columns-for-maximum-number-of-equal-rows
1256-rank-transform-of-an-array
1319-unique-number-of-occurrences
1325-path-with-maximum-probability
1342-queens-that-can-attack-the-king
1349-check-if-it-is-a-straight-line
1350-remove-sub-folders-from-the-filesystem
1354-find-players-with-zero-or-one-losses
1400-find-winner-on-a-tic-tac-toe-game
1402-count-square-submatrices-with-all-ones
1422-divide-array-in-sets-of-k-consecutive-numbers
1428-jump-game-iii
1468-check-if-n-and-its-double-exist
1524-string-matching-in-an-array
1528-kids-with-the-greatest-number-of-candies
1539-diagonal-traverse-ii
1580-shuffle-the-array
1586-longest-subarray-of-1s-after-deleting-one-element
1620-check-if-array-pairs-are-divisible-by-k
1646-kth-missing-positive-number
1677-matrix-diagonal-sum
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1694-make-sum-divisible-by-p
1706-min-cost-to-connect-all-points
1720-crawler-log-folder
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
1798-max-number-of-k-sum-pairs
1833-find-the-highest-altitude
1876-map-of-highest-peak
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
1940-maximum-xor-for-each-query
1972-rotating-the-box
1988-minimize-maximum-pair-sum-in-array
2006-find-the-student-that-will-replace-the-chalk
2038-nearest-exit-from-entrance-in-maze
2048-build-array-from-permutation
2054-the-number-of-the-smallest-unoccupied-chair
2058-concatenation-of-array
2089-maximum-matrix-sum
2094-remove-stones-to-minimize-the-total
2103-find-all-groups-of-farmland
2106-find-greatest-common-divisor-of-array
2132-convert-1d-array-into-2d-array
2164-two-best-non-overlapping-events
2170-count-number-of-maximum-bitwise-or-subsets
2179-most-beautiful-item-for-each-query
2188-minimized-maximum-of-products-distributed-to-any-store
2206-detonate-the-maximum-bombs
2232-adding-spaces-to-a-string
2271-rearrange-array-elements-by-sign
2306-create-binary-tree-from-descriptions
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
2428-equal-row-and-column-pairs
2465-shifting-letters-ii
2488-divide-intervals-into-minimum-number-of-groups
2536-determine-if-two-events-have-conflict
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
2616-maximal-score-after-applying-k-operations
2640-maximum-number-of-integers-to-choose-from-a-range-i
2662-check-knight-tour-configuration
2676-find-the-score-of-all-prefixes-of-an-array
2691-count-vowel-strings-in-ranges
2695-find-score-of-an-array-after-marking-all-elements
2699-count-the-number-of-fair-pairs
2711-minimum-time-to-visit-a-cell-in-a-grid
2727-number-of-senior-citizens
2794-maximum-number-of-moves-in-a-grid
2868-continuous-subarrays
3176-minimum-sum-of-mountain-triplets-i
3181-find-building-where-alice-and-bob-can-meet
3221-find-the-peaks
3227-find-missing-and-repeated-values
3242-count-elements-with-maximum-frequency
3251-maximum-area-of-longest-diagonal-rectangle
3291-find-if-array-can-be-sorted
3380-shortest-subarray-with-or-at-least-k-ii
3427-special-array-ii
3429-special-array-i
3471-minimum-average-of-smallest-and-largest-elements
3517-shortest-distance-after-road-addition-queries-i
3522-find-the-power-of-k-size-subarrays-i
3523-find-the-power-of-k-size-subarrays-ii
3555-final-array-state-after-k-multiplication-operations-i
3558-find-a-safe-walk-through-a-grid
3627-find-minimum-time-to-reach-last-room-i

Matrix

0036-valid-sudoku
0048-rotate-image
0054-spiral-matrix
0059-spiral-matrix-ii
0063-unique-paths-ii
0064-minimum-path-sum
0073-set-matrix-zeroes
0074-search-a-2d-matrix
0130-surrounded-regions
0200-number-of-islands
0289-game-of-life
0419-battleships-in-a-board
0463-island-perimeter
0498-diagonal-traverse
0529-minesweeper
0542-01-matrix
0695-max-area-of-island
0733-flood-fill
0787-sliding-puzzle
0898-transpose-matrix
0967-minimum-falling-path-sum
0999-regions-cut-by-slashes
1036-rotting-oranges
1041-available-captures-for-rook
1073-number-of-enclaves
1104-coloring-a-border
1147-flip-columns-for-maximum-number-of-equal-rows
1342-queens-that-can-attack-the-king
1400-find-winner-on-a-tic-tac-toe-game
1402-count-square-submatrices-with-all-ones
1677-matrix-diagonal-sum
1876-map-of-highest-peak
1972-rotating-the-box
2038-nearest-exit-from-entrance-in-maze
2089-maximum-matrix-sum
2103-find-all-groups-of-farmland
2132-convert-1d-array-into-2d-array
2343-count-unguarded-cells-in-the-grid
2375-minimum-obstacle-removal-to-reach-corner
2428-equal-row-and-column-pairs
2662-check-knight-tour-configuration
2711-minimum-time-to-visit-a-cell-in-a-grid
2794-maximum-number-of-moves-in-a-grid
3227-find-missing-and-repeated-values
3558-find-a-safe-walk-through-a-grid
3627-find-minimum-time-to-reach-last-room-i

Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0112-path-sum
0113-path-sum-ii
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0117-populating-next-right-pointers-in-each-node-ii
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0257-binary-tree-paths
0404-sum-of-left-leaves
0449-serialize-and-deserialize-bst
0450-delete-node-in-a-bst
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0606-construct-string-from-binary-tree
0623-add-one-row-to-tree
0783-search-in-a-binary-search-tree
0784-insert-into-a-binary-search-tree
0789-kth-largest-element-in-a-stream
0988-flip-equivalent-binary-trees
1035-cousins-in-binary-tree
1079-sum-of-root-to-leaf-binary-numbers
1116-maximum-level-sum-of-a-binary-tree
2306-create-binary-tree-from-descriptions
2416-evaluate-boolean-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
3439-find-minimum-diameter-after-merging-two-trees

Binary Search Tree

0004-median-of-two-sorted-arrays
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0069-sqrtx
0074-search-a-2d-matrix
0098-validate-binary-search-tree
0153-find-minimum-in-rotated-sorted-array
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0209-minimum-size-subarray-sum
0230-kth-smallest-element-in-a-bst
0268-missing-number
0275-h-index-ii
0287-find-the-duplicate-number
0300-longest-increasing-subsequence
0367-valid-perfect-square
0374-guess-number-higher-or-lower
0441-arranging-coins
0449-serialize-and-deserialize-bst
0450-delete-node-in-a-bst
0540-single-element-in-a-sorted-array
0729-my-calendar-i
0783-search-in-a-binary-search-tree
0784-insert-into-a-binary-search-tree
0789-kth-largest-element-in-a-stream
0792-binary-search
0882-peak-index-in-a-mountain-array
0892-shortest-subarray-with-sum-at-least-k
1046-max-consecutive-ones-iii
1468-check-if-n-and-its-double-exist
1646-kth-missing-positive-number
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
2006-find-the-student-that-will-replace-the-chalk
2164-two-best-non-overlapping-events
2179-most-beautiful-item-for-each-query
2188-minimized-maximum-of-products-distributed-to-any-store
2586-longest-square-streak-in-an-array
2640-maximum-number-of-integers-to-choose-from-a-range-i
2699-count-the-number-of-fair-pairs
3181-find-building-where-alice-and-bob-can-meet
3427-special-array-ii

Binary Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0112-path-sum
0113-path-sum-ii
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0117-populating-next-right-pointers-in-each-node-ii
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0257-binary-tree-paths
0404-sum-of-left-leaves
0449-serialize-and-deserialize-bst
0450-delete-node-in-a-bst
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0606-construct-string-from-binary-tree
0623-add-one-row-to-tree
0783-search-in-a-binary-search-tree
0784-insert-into-a-binary-search-tree
0789-kth-largest-element-in-a-stream
0988-flip-equivalent-binary-trees
1035-cousins-in-binary-tree
1079-sum-of-root-to-leaf-binary-numbers
1116-maximum-level-sum-of-a-binary-tree
2306-create-binary-tree-from-descriptions
2416-evaluate-boolean-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

Two Pointers

0005-longest-palindromic-substring
0011-container-with-most-water
0015-3sum
0018-4sum
0019-remove-nth-node-from-end-of-list
0026-remove-duplicates-from-sorted-array
0027-remove-element
0028-find-the-index-of-the-first-occurrence-in-a-string
0042-trapping-rain-water
0061-rotate-list
0075-sort-colors
0082-remove-duplicates-from-sorted-list-ii
0125-valid-palindrome
0141-linked-list-cycle
0142-linked-list-cycle-ii
0151-reverse-words-in-a-string
0160-intersection-of-two-linked-lists
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0234-palindrome-linked-list
0283-move-zeroes
0287-find-the-duplicate-number
0344-reverse-string
0392-is-subsequence
0443-string-compression
0528-swapping-nodes-in-a-linked-list
0680-valid-palindrome-ii
0908-middle-of-the-linked-list
0917-boats-to-save-people
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
1798-max-number-of-k-sum-pairs
1894-merge-strings-alternately
1972-rotating-the-box
1988-minimize-maximum-pair-sum-in-array
2095-minimum-number-of-swaps-to-make-the-string-balanced
2216-delete-the-middle-node-of-a-linked-list
2232-adding-spaces-to-a-string
2236-maximum-twin-sum-of-a-linked-list
2271-rearrange-array-elements-by-sign
2414-move-pieces-to-obtain-a-string
2481-strictly-palindromic-number
2488-divide-intervals-into-minimum-number-of-groups
2581-divide-players-into-teams-of-equal-skill
2699-count-the-number-of-fair-pairs
3018-make-string-a-subsequence-using-cyclic-increments
3195-separate-black-and-white-balls
3471-minimum-average-of-smallest-and-largest-elements

Brainteaser

0292-nim-game
2481-strictly-palindromic-number

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0112-path-sum
0116-populating-next-right-pointers-in-each-node
0117-populating-next-right-pointers-in-each-node-ii
0130-surrounded-regions
0133-clone-graph
0199-binary-tree-right-side-view
0200-number-of-islands
0207-course-schedule
0226-invert-binary-tree
0322-coin-change
0404-sum-of-left-leaves
0449-serialize-and-deserialize-bst
0463-island-perimeter
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0529-minesweeper
0542-01-matrix
0547-number-of-provinces
0623-add-one-row-to-tree
0695-max-area-of-island
0733-flood-fill
0787-sliding-puzzle
0801-is-graph-bipartite
0871-keys-and-rooms
0999-regions-cut-by-slashes
1035-cousins-in-binary-tree
1036-rotting-oranges
1073-number-of-enclaves
1104-coloring-a-border
1116-maximum-level-sum-of-a-binary-tree
1428-jump-game-iii
1876-map-of-highest-peak
2038-nearest-exit-from-entrance-in-maze
2103-find-all-groups-of-farmland
2121-find-if-path-exists-in-graph
2206-detonate-the-maximum-bombs
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
2662-check-knight-tour-configuration
2677-cousins-in-binary-tree-ii
2711-minimum-time-to-visit-a-cell-in-a-grid
3439-find-minimum-diameter-after-merging-two-trees
3517-shortest-distance-after-road-addition-queries-i
3558-find-a-safe-walk-through-a-grid
3561-remove-methods-from-project

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0006-zigzag-conversion
0008-string-to-integer-atoi
0010-regular-expression-matching
0012-integer-to-roman
0013-roman-to-integer
0014-longest-common-prefix
0017-letter-combinations-of-a-phone-number
0020-valid-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0038-count-and-say
0049-group-anagrams
0058-length-of-last-word
0068-text-justification
0071-simplify-path
0125-valid-palindrome
0151-reverse-words-in-a-string
0168-excel-sheet-column-title
0171-excel-sheet-column-number
0179-largest-number
0205-isomorphic-strings
0208-implement-trie-prefix-tree
0211-design-add-and-search-words-data-structure
0227-basic-calculator-ii
0242-valid-anagram
0257-binary-tree-paths
0290-word-pattern
0344-reverse-string
0392-is-subsequence
0394-decode-string
0412-fizz-buzz
0443-string-compression
0449-serialize-and-deserialize-bst
0451-sort-characters-by-frequency
0520-detect-capital
0535-encode-and-decode-tinyurl
0539-minimum-time-difference
0606-construct-string-from-binary-tree
0657-robot-return-to-origin
0680-valid-palindrome-ii
0692-top-k-frequent-words
0778-reorganize-string
0812-rotate-string
0878-shifting-letters
0957-minimum-add-to-make-parentheses-valid
1146-greatest-common-divisor-of-strings
1197-parsing-a-boolean-expression
1250-longest-common-subsequence
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
1512-design-underground-system
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1561-rearrange-words-in-a-sentence
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1567-maximum-number-of-vowels-in-a-substring-of-given-length
1619-path-crossing
1667-find-kth-bit-in-nth-binary-string
1714-rearrange-spaces-between-words
1715-split-a-string-into-the-max-number-of-unique-substrings
1720-crawler-log-folder
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1777-determine-if-two-strings-are-close
1894-merge-strings-alternately
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2059-unique-length-3-palindromic-subsequences
2076-sum-of-digits-of-string-after-convert
2095-minimum-number-of-swaps-to-make-the-string-balanced
2232-adding-spaces-to-a-string
2300-construct-string-with-repeat-limit
2345-minimum-number-of-operations-to-convert-time
2391-strong-password-checker-ii
2414-move-pieces-to-obtain-a-string
2465-shifting-letters-ii
2470-removing-stars-from-a-string
2492-length-of-the-longest-alphabetical-continuous-substring
2536-determine-if-two-events-have-conflict
2580-circular-sentence
2599-take-k-of-each-character-from-left-and-right
2691-count-vowel-strings-in-ranges
2727-number-of-senior-citizens
3018-make-string-a-subsequence-using-cyclic-increments
3174-minimum-number-of-changes-to-make-binary-string-beautiful
3195-separate-black-and-white-balls
3379-score-of-a-string
3451-string-compression-iii

Bit Manipulation

0029-divide-two-integers
0078-subsets
0090-subsets-ii
0136-single-number
0201-bitwise-and-of-numbers-range
0231-power-of-two
0260-single-number-iii
0268-missing-number
0287-find-the-duplicate-number
0338-counting-bits
0342-power-of-four
0476-number-complement
0645-set-mismatch
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
3291-find-if-array-can-be-sorted
3380-shortest-subarray-with-or-at-least-k-ii
3394-minimum-array-end

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0012-integer-to-roman
0013-roman-to-integer
0017-letter-combinations-of-a-phone-number
0036-valid-sudoku
0041-first-missing-positive
0049-group-anagrams
0073-set-matrix-zeroes
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0128-longest-consecutive-sequence
0133-clone-graph
0138-copy-list-with-random-pointer
0141-linked-list-cycle
0142-linked-list-cycle-ii
0160-intersection-of-two-linked-lists
0169-majority-element
0205-isomorphic-strings
0208-implement-trie-prefix-tree
0217-contains-duplicate
0219-contains-duplicate-ii
0242-valid-anagram
0268-missing-number
0290-word-pattern
0347-top-k-frequent-elements
0442-find-all-duplicates-in-an-array
0448-find-all-numbers-disappeared-in-an-array
0451-sort-characters-by-frequency
0496-next-greater-element-i
0535-encode-and-decode-tinyurl
0554-brick-wall
0560-subarray-sum-equals-k
0645-set-mismatch
0692-top-k-frequent-words
0778-reorganize-string
0876-hand-of-straights
0906-walking-robot-simulation
0999-regions-cut-by-slashes
1039-find-the-town-judge
1147-flip-columns-for-maximum-number-of-equal-rows
1256-rank-transform-of-an-array
1319-unique-number-of-occurrences
1354-find-players-with-zero-or-one-losses
1400-find-winner-on-a-tic-tac-toe-game
1422-divide-array-in-sets-of-k-consecutive-numbers
1468-check-if-n-and-its-double-exist
1512-design-underground-system
1619-path-crossing
1620-check-if-array-pairs-are-divisible-by-k
1694-make-sum-divisible-by-p
1715-split-a-string-into-the-max-number-of-unique-substrings
1777-determine-if-two-strings-are-close
1798-max-number-of-k-sum-pairs
2054-the-number-of-the-smallest-unoccupied-chair
2059-unique-length-3-palindromic-subsequences
2300-construct-string-with-repeat-limit
2306-create-binary-tree-from-descriptions
2356-largest-combination-with-bitwise-and-greater-than-zero
2413-smallest-number-in-infinite-set
2428-equal-row-and-column-pairs
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
2695-find-score-of-an-array-after-marking-all-elements
2824-check-if-the-number-is-fascinating
3227-find-missing-and-repeated-values
3242-count-elements-with-maximum-frequency

Trie

0014-longest-common-prefix
0208-implement-trie-prefix-tree
0211-design-add-and-search-words-data-structure
0386-lexicographical-numbers
0692-top-k-frequent-words
1350-remove-sub-folders-from-the-filesystem

Sorting

0015-3sum
0018-4sum
0049-group-anagrams
0056-merge-intervals
0075-sort-colors
0147-insertion-sort-list
0164-maximum-gap
0169-majority-element
0179-largest-number
0215-kth-largest-element-in-an-array
0217-contains-duplicate
0242-valid-anagram
0268-missing-number
0347-top-k-frequent-elements
0414-third-maximum-number
0435-non-overlapping-intervals
0451-sort-characters-by-frequency
0452-minimum-number-of-arrows-to-burst-balloons
0539-minimum-time-difference
0645-set-mismatch
0692-top-k-frequent-words
0778-reorganize-string
0780-max-chunks-to-make-sorted
0876-hand-of-straights
0917-boats-to-save-people
0948-sort-an-array
1137-height-checker
1256-rank-transform-of-an-array
1354-find-players-with-zero-or-one-losses
1422-divide-array-in-sets-of-k-consecutive-numbers
1468-check-if-n-and-its-double-exist
1539-diagonal-traverse-ii
1561-rearrange-words-in-a-sentence
1777-determine-if-two-strings-are-close
1798-max-number-of-k-sum-pairs
1988-minimize-maximum-pair-sum-in-array
2164-two-best-non-overlapping-events
2179-most-beautiful-item-for-each-query
2284-smallest-value-of-the-rearranged-number
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
3291-find-if-array-can-be-sorted
3471-minimum-average-of-smallest-and-largest-elements

Heap (Priority Queue)

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements
0451-sort-characters-by-frequency
0692-top-k-frequent-words
0778-reorganize-string
0789-kth-largest-element-in-a-stream
0892-shortest-subarray-with-sum-at-least-k
0948-sort-an-array
1127-last-stone-weight
1304-longest-happy-string
1325-path-with-maximum-probability
1539-diagonal-traverse-ii
1917-maximum-average-pass-ratio
1955-seat-reservation-manager
2054-the-number-of-the-smallest-unoccupied-chair
2094-remove-stones-to-minimize-the-total
2164-two-best-non-overlapping-events
2300-construct-string-with-repeat-limit
2375-minimum-obstacle-removal-to-reach-corner
2413-smallest-number-in-infinite-set
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
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
3555-final-array-state-after-k-multiplication-operations-i
3558-find-a-safe-walk-through-a-grid
3627-find-minimum-time-to-reach-last-room-i

Bucket Sort

0164-maximum-gap
0347-top-k-frequent-elements
0451-sort-characters-by-frequency
0692-top-k-frequent-words
0948-sort-an-array

Counting

0169-majority-element
0347-top-k-frequent-elements
0451-sort-characters-by-frequency
0692-top-k-frequent-words
0778-reorganize-string
1354-find-players-with-zero-or-one-losses
1620-check-if-array-pairs-are-divisible-by-k
1777-determine-if-two-strings-are-close
2300-construct-string-with-repeat-limit
2356-largest-combination-with-bitwise-and-greater-than-zero
3242-count-elements-with-maximum-frequency

Divide and Conquer

0004-median-of-two-sorted-arrays
0023-merge-k-sorted-lists
0053-maximum-subarray
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0169-majority-element
0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements
0948-sort-an-array

Quickselect

0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements

Geometry

0223-rectangle-area
0593-valid-square
0915-generate-random-point-in-a-circle
1349-check-if-it-is-a-straight-line
2206-detonate-the-maximum-bombs
2575-minimum-cuts-to-divide-a-circle

Radix Sort

0164-maximum-gap
0948-sort-an-array

Enumeration

0204-count-primes
2083-three-divisors
2170-count-number-of-maximum-bitwise-or-subsets
3221-find-the-peaks

Number Theory

0204-count-primes
0258-add-digits
2083-three-divisors
2106-find-greatest-common-divisor-of-array
2491-smallest-even-multiple

Dynamic Programming

0005-longest-palindromic-substring
0010-regular-expression-matching
0042-trapping-rain-water
0045-jump-game-ii
0053-maximum-subarray
0055-jump-game
0062-unique-paths
0063-unique-paths-ii
0064-minimum-path-sum
0070-climbing-stairs
0118-pascals-triangle
0120-triangle
0121-best-time-to-buy-and-sell-stock
0152-maximum-product-subarray
0198-house-robber
0213-house-robber-ii
0300-longest-increasing-subsequence
0322-coin-change
0338-counting-bits
0392-is-subsequence
0435-non-overlapping-intervals
0494-target-sum
0542-01-matrix
0650-2-keys-keyboard
0689-maximum-sum-of-3-non-overlapping-subarrays
0747-min-cost-climbing-stairs
0967-minimum-falling-path-sum
1013-fibonacci-number
1025-minimum-cost-for-tickets
1236-n-th-tribonacci-number
1250-longest-common-subsequence
1402-count-square-submatrices-with-all-ones
1586-longest-subarray-of-1s-after-deleting-one-element
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1766-minimum-number-of-removals-to-make-mountain-array
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

Database

0175-combine-two-tables
0176-second-highest-salary
0177-nth-highest-salary
0181-employees-earning-more-than-their-managers
0182-duplicate-emails
0584-find-customer-referee
1258-article-views-i
1908-recyclable-and-low-fat-products

Backtracking

0017-letter-combinations-of-a-phone-number
0046-permutations
0047-permutations-ii
0051-n-queens
0052-n-queens-ii
0078-subsets
0090-subsets-ii
0113-path-sum-ii
0257-binary-tree-paths
0494-target-sum
1715-split-a-string-into-the-max-number-of-unique-substrings
2170-count-number-of-maximum-bitwise-or-subsets

Prefix Sum

0209-minimum-size-subarray-sum
0238-product-of-array-except-self
0560-subarray-sum-equals-k
0724-find-pivot-index
0878-shifting-letters
0892-shortest-subarray-with-sum-at-least-k
1046-max-consecutive-ones-iii
1537-maximum-score-after-splitting-a-string
1694-make-sum-divisible-by-p
1833-find-the-highest-altitude
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1940-maximum-xor-for-each-query
2006-find-the-student-that-will-replace-the-chalk
2059-unique-length-3-palindromic-subsequences
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
2488-divide-intervals-into-minimum-number-of-groups
2676-find-the-score-of-all-prefixes-of-an-array
2691-count-vowel-strings-in-ranges
3427-special-array-ii

Sliding Window

0003-longest-substring-without-repeating-characters
0209-minimum-size-subarray-sum
0219-contains-duplicate-ii
0643-maximum-average-subarray-i
0892-shortest-subarray-with-sum-at-least-k
1046-max-consecutive-ones-iii
1567-maximum-number-of-vowels-in-a-substring-of-given-length
1586-longest-subarray-of-1s-after-deleting-one-element
1755-defuse-the-bomb
2552-maximum-sum-of-distinct-subarrays-with-length-k
2599-take-k-of-each-character-from-left-and-right
2868-continuous-subarrays
3380-shortest-subarray-with-or-at-least-k-ii
3522-find-the-power-of-k-size-subarrays-i
3523-find-the-power-of-k-size-subarrays-ii

Monotonic Stack

0042-trapping-rain-water
0496-next-greater-element-i
0739-daily-temperatures
0780-max-chunks-to-make-sorted
1002-maximum-width-ramp
1072-next-greater-node-in-linked-list
1679-shortest-subarray-to-be-removed-to-make-array-sorted
3181-find-building-where-alice-and-bob-can-meet

Depth-First Search

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0112-path-sum
0113-path-sum-ii
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0117-populating-next-right-pointers-in-each-node-ii
0130-surrounded-regions
0133-clone-graph
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0200-number-of-islands
0207-course-schedule
0211-design-add-and-search-words-data-structure
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0257-binary-tree-paths
0386-lexicographical-numbers
0404-sum-of-left-leaves
0419-battleships-in-a-board
0449-serialize-and-deserialize-bst
0463-island-perimeter
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0529-minesweeper
0547-number-of-provinces
0606-construct-string-from-binary-tree
0623-add-one-row-to-tree
0695-max-area-of-island
0733-flood-fill
0801-is-graph-bipartite
0871-keys-and-rooms
0988-flip-equivalent-binary-trees
0999-regions-cut-by-slashes
1035-cousins-in-binary-tree
1073-number-of-enclaves
1079-sum-of-root-to-leaf-binary-numbers
1104-coloring-a-border
1116-maximum-level-sum-of-a-binary-tree
1350-remove-sub-folders-from-the-filesystem
1428-jump-game-iii
2103-find-all-groups-of-farmland
2121-find-if-path-exists-in-graph
2201-valid-arrangement-of-pairs
2206-detonate-the-maximum-bombs
2416-evaluate-boolean-binary-tree
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2662-check-knight-tour-configuration
2677-cousins-in-binary-tree-ii
3439-find-minimum-diameter-after-merging-two-trees
3561-remove-methods-from-project

Simulation

0054-spiral-matrix
0059-spiral-matrix-ii
0068-text-justification
0258-add-digits
0289-game-of-life
0412-fizz-buzz
0498-diagonal-traverse
0657-robot-return-to-origin
0735-asteroid-collision
0898-transpose-matrix
0906-walking-robot-simulation
0983-validate-stack-sequences
1041-available-captures-for-rook
1342-queens-that-can-attack-the-king
1400-find-winner-on-a-tic-tac-toe-game
1667-find-kth-bit-in-nth-binary-string
2006-find-the-student-that-will-replace-the-chalk
2048-build-array-from-permutation
2058-concatenation-of-array
2076-sum-of-digits-of-string-after-convert
2132-convert-1d-array-into-2d-array
2232-adding-spaces-to-a-string
2271-rearrange-array-elements-by-sign
2278-find-three-consecutive-integers-that-sum-to-a-given-number
2343-count-unguarded-cells-in-the-grid
2428-equal-row-and-column-pairs
2470-removing-stars-from-a-string
2662-check-knight-tour-configuration
2695-find-score-of-an-array-after-marking-all-elements
2857-total-distance-traveled
3555-final-array-state-after-k-multiplication-operations-i

Game Theory

0292-nim-game

Memoization

0070-climbing-stairs
1013-fibonacci-number
1236-n-th-tribonacci-number

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
0812-rotate-string
1524-string-matching-in-an-array
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence

Merge Sort

0023-merge-k-sorted-lists
0948-sort-an-array

Counting Sort

0948-sort-an-array
1137-height-checker

Combinatorics

0062-unique-paths

Design

0155-min-stack
0208-implement-trie-prefix-tree
0211-design-add-and-search-words-data-structure
0225-implement-stack-using-queues
0232-implement-queue-using-stacks
0449-serialize-and-deserialize-bst
0535-encode-and-decode-tinyurl
0729-my-calendar-i
0789-kth-largest-element-in-a-stream
0969-number-of-recent-calls
1512-design-underground-system
1955-seat-reservation-manager
2413-smallest-number-in-infinite-set

Queue

0225-implement-stack-using-queues
0232-implement-queue-using-stacks
0892-shortest-subarray-with-sum-at-least-k
0969-number-of-recent-calls
2868-continuous-subarrays

Union Find

0128-longest-consecutive-sequence
0130-surrounded-regions
0200-number-of-islands
0547-number-of-provinces
0695-max-area-of-island
0801-is-graph-bipartite
0999-regions-cut-by-slashes
1073-number-of-enclaves
1706-min-cost-to-connect-all-points
2121-find-if-path-exists-in-graph

Interactive

0374-guess-number-higher-or-lower

Segment Tree

0729-my-calendar-i
3181-find-building-where-alice-and-bob-can-meet

Ordered Set

0729-my-calendar-i
2413-smallest-number-in-infinite-set
2868-continuous-subarrays

Graph

0133-clone-graph
0207-course-schedule
0547-number-of-provinces
0801-is-graph-bipartite
0871-keys-and-rooms
1039-find-the-town-judge
1325-path-with-maximum-probability
1661-minimum-number-of-vertices-to-reach-all-nodes
1706-min-cost-to-connect-all-points
1916-find-center-of-star-graph
2121-find-if-path-exists-in-graph
2201-valid-arrangement-of-pairs
2206-detonate-the-maximum-bombs
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
3189-find-champion-ii
3439-find-minimum-diameter-after-merging-two-trees
3517-shortest-distance-after-road-addition-queries-i
3558-find-a-safe-walk-through-a-grid
3561-remove-methods-from-project
3627-find-minimum-time-to-reach-last-room-i

Rejection Sampling

0915-generate-random-point-in-a-circle

Randomized

0382-linked-list-random-node
0915-generate-random-point-in-a-circle

Monotonic Queue

0892-shortest-subarray-with-sum-at-least-k
2868-continuous-subarrays

Shortest Path

1325-path-with-maximum-probability
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
3558-find-a-safe-walk-through-a-grid
3627-find-minimum-time-to-reach-last-room-i

Minimum Spanning Tree

1706-min-cost-to-connect-all-points

Data Stream

0789-kth-largest-element-in-a-stream
0969-number-of-recent-calls

Topological Sort

0207-course-schedule

Eulerian Circuit

2201-valid-arrangement-of-pairs

Binary Indexed Tree

3181-find-building-where-alice-and-bob-can-meet

Reservoir Sampling

0382-linked-list-random-node

Hash Function

0535-encode-and-decode-tinyurl

Concurrency

1187-print-foobar-alternately
1203-print-in-order
1340-the-dining-philosophers

Releases

No releases published

Packages

No packages published