Skip to content

Latest commit

 

History

602 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode

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

LeetCode Topics

Linked List

0019-remove-nth-node-from-end-of-list
0061-rotate-list

Two Pointers

0005-longest-palindromic-substring
0019-remove-nth-node-from-end-of-list
0026-remove-duplicates-from-sorted-array
0061-rotate-list
0080-remove-duplicates-from-sorted-array-ii
0088-merge-sorted-array
0455-assign-cookies
0653-two-sum-iv-input-is-a-bst
0881-boats-to-save-people
3302-find-the-lexicographically-smallest-valid-sequence
3534-path-existence-queries-in-a-graph-ii
3734-lexicographically-smallest-palindromic-permutation-greater-than-target
3867-sum-of-gcd-of-formed-pairs

Array

0001-two-sum
0026-remove-duplicates-from-sorted-array
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0039-combination-sum
0053-maximum-subarray
0055-jump-game
0074-search-a-2d-matrix
0080-remove-duplicates-from-sorted-array-ii
0088-merge-sorted-array
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0123-best-time-to-buy-and-sell-stock-iii
0130-surrounded-regions
0134-gas-station
0136-single-number
0153-find-minimum-in-rotated-sorted-array
0169-majority-element
0188-best-time-to-buy-and-sell-stock-iv
0198-house-robber
0200-number-of-islands
0215-kth-largest-element-in-an-array
0217-contains-duplicate
0229-majority-element-ii
0238-product-of-array-except-self
0300-longest-increasing-subsequence
0322-coin-change
0347-top-k-frequent-elements
0378-kth-smallest-element-in-a-sorted-matrix
0416-partition-equal-subset-sum
0455-assign-cookies
0486-predict-the-winner
0494-target-sum
0621-task-scheduler
0628-maximum-product-of-three-numbers
0692-top-k-frequent-words
0704-binary-search
0739-daily-temperatures
0852-peak-index-in-a-mountain-array
0875-koko-eating-bananas
0877-stone-game
0881-boats-to-save-people
0994-rotting-oranges
1260-shift-2d-grid
1288-remove-covered-intervals
1301-number-of-paths-with-max-score
1331-rank-transform-of-an-array
1386-cinema-seat-allocation
1406-stone-game-iii
1464-maximum-product-of-two-elements-in-an-array
1482-minimum-number-of-days-to-make-m-bouquets
1547-minimum-cost-to-cut-a-stick
1563-stone-game-v
1631-path-with-minimum-effort
1652-defuse-the-bomb
1846-maximum-element-after-decreasing-and-rearranging
1967-number-of-strings-that-appear-as-substrings-in-word
1979-find-greatest-common-divisor-of-array
2029-stone-game-ix
2091-removing-minimum-and-maximum-from-array
2213-longest-substring-of-one-repeating-character
2812-find-the-safest-path-in-a-grid
2958-length-of-longest-subarray-with-at-most-k-frequency
2996-smallest-missing-integer-greater-than-sequential-prefix-sum
3020-find-the-maximum-number-of-elements-in-subset
3069-distribute-elements-into-two-arrays-i
3116-kth-smallest-amount-with-single-denomination-combination
3471-find-the-largest-almost-missing-integer
3501-maximize-active-section-with-trade-ii
3513-number-of-unique-xor-triplets-i
3514-number-of-unique-xor-triplets-ii
3532-path-existence-queries-in-a-graph-i
3534-path-existence-queries-in-a-graph-ii
3620-network-recovery-pathways
3702-longest-subsequence-with-non-zero-bitwise-xor
3731-find-missing-elements
3739-count-subarrays-with-majority-element-ii
3867-sum-of-gcd-of-formed-pairs

Hash Table

0001-two-sum
0017-letter-combinations-of-a-phone-number
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0127-word-ladder
0169-majority-element
0217-contains-duplicate
0229-majority-element-ii
0347-top-k-frequent-elements
0621-task-scheduler
0653-two-sum-iv-input-is-a-bst
0692-top-k-frequent-words
0767-reorganize-string
0771-jewels-and-stones
1331-rank-transform-of-an-array
1386-cinema-seat-allocation
2958-length-of-longest-subarray-with-at-most-k-frequency
2996-smallest-missing-integer-greater-than-sequential-prefix-sum
3020-find-the-maximum-number-of-elements-in-subset
3090-maximum-length-substring-with-two-occurrences
3471-find-the-largest-almost-missing-integer
3532-path-existence-queries-in-a-graph-i
3720-lexicographically-smallest-permutation-greater-than-target
3731-find-missing-elements
3739-count-subarrays-with-majority-element-ii

Divide and Conquer

0053-maximum-subarray
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0169-majority-element
0191-number-of-1-bits
0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements
3739-count-subarrays-with-majority-element-ii

Segment Tree

2213-longest-substring-of-one-repeating-character
3501-maximize-active-section-with-trade-ii
3739-count-subarrays-with-majority-element-ii

Merge Sort

3739-count-subarrays-with-majority-element-ii

Prefix Sum

0238-product-of-array-except-self
3739-count-subarrays-with-majority-element-ii
3756-concatenate-non-zero-digits-and-multiply-by-sum-ii

Enumeration

3020-find-the-maximum-number-of-elements-in-subset
3514-number-of-unique-xor-triplets-ii
3720-lexicographically-smallest-permutation-greater-than-target
3734-lexicographically-smallest-palindromic-permutation-greater-than-target

Binary Search

0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0074-search-a-2d-matrix
0153-find-minimum-in-rotated-sorted-array
0300-longest-increasing-subsequence
0378-kth-smallest-element-in-a-sorted-matrix
0704-binary-search
0852-peak-index-in-a-mountain-array
0875-koko-eating-bananas
1482-minimum-number-of-days-to-make-m-bouquets
1631-path-with-minimum-effort
2812-find-the-safest-path-in-a-grid
3116-kth-smallest-amount-with-single-denomination-combination
3501-maximize-active-section-with-trade-ii
3532-path-existence-queries-in-a-graph-i
3534-path-existence-queries-in-a-graph-ii
3620-network-recovery-pathways

Greedy

0055-jump-game
0122-best-time-to-buy-and-sell-stock-ii
0134-gas-station
0455-assign-cookies
0621-task-scheduler
0767-reorganize-string
0881-boats-to-save-people
1386-cinema-seat-allocation
1846-maximum-element-after-decreasing-and-rearranging
1927-sum-game
2029-stone-game-ix
2091-removing-minimum-and-maximum-from-array
3014-minimum-number-of-pushes-to-type-word-i
3302-find-the-lexicographically-smallest-valid-sequence
3348-smallest-divisible-digit-product-ii
3534-path-existence-queries-in-a-graph-ii
3720-lexicographically-smallest-permutation-greater-than-target

Sorting

0088-merge-sorted-array
0169-majority-element
0215-kth-largest-element-in-an-array
0217-contains-duplicate
0229-majority-element-ii
0347-top-k-frequent-elements
0378-kth-smallest-element-in-a-sorted-matrix
0455-assign-cookies
0621-task-scheduler
0628-maximum-product-of-three-numbers
0692-top-k-frequent-words
0767-reorganize-string
0881-boats-to-save-people
1288-remove-covered-intervals
1331-rank-transform-of-an-array
1464-maximum-product-of-two-elements-in-an-array
1547-minimum-cost-to-cut-a-stick
1846-maximum-element-after-decreasing-and-rearranging
2996-smallest-missing-integer-greater-than-sequential-prefix-sum
3534-path-existence-queries-in-a-graph-ii
3731-find-missing-elements
3867-sum-of-gcd-of-formed-pairs

String

0005-longest-palindromic-substring
0017-letter-combinations-of-a-phone-number
0022-generate-parentheses
0093-restore-ip-addresses
0127-word-ladder
0692-top-k-frequent-words
0767-reorganize-string
0771-jewels-and-stones
1143-longest-common-subsequence
1927-sum-game
1967-number-of-strings-that-appear-as-substrings-in-word
2213-longest-substring-of-one-repeating-character
3014-minimum-number-of-pushes-to-type-word-i
3090-maximum-length-substring-with-two-occurrences
3302-find-the-lexicographically-smallest-valid-sequence
3348-smallest-divisible-digit-product-ii
3501-maximize-active-section-with-trade-ii
3720-lexicographically-smallest-permutation-greater-than-target
3734-lexicographically-smallest-palindromic-permutation-greater-than-target
3756-concatenate-non-zero-digits-and-multiply-by-sum-ii

Matrix

0074-search-a-2d-matrix
0130-surrounded-regions
0200-number-of-islands
0378-kth-smallest-element-in-a-sorted-matrix
0994-rotting-oranges
1260-shift-2d-grid
1301-number-of-paths-with-max-score
1631-path-with-minimum-effort
2812-find-the-safest-path-in-a-grid

Heap (Priority Queue)

0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements
0378-kth-smallest-element-in-a-sorted-matrix
0621-task-scheduler
0692-top-k-frequent-words
0743-network-delay-time
0767-reorganize-string
0787-cheapest-flights-within-k-stops
1464-maximum-product-of-two-elements-in-an-array
1631-path-with-minimum-effort
2812-find-the-safest-path-in-a-grid
3620-network-recovery-pathways

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0107-binary-tree-level-order-traversal-ii
0112-path-sum
0127-word-ladder
0130-surrounded-regions
0200-number-of-islands
0226-invert-binary-tree
0322-coin-change
0653-two-sum-iv-input-is-a-bst
0743-network-delay-time
0785-is-graph-bipartite
0787-cheapest-flights-within-k-stops
0958-check-completeness-of-a-binary-tree
0994-rotting-oranges
1631-path-with-minimum-effort
2685-count-the-number-of-complete-components
2812-find-the-safest-path-in-a-grid
3310-remove-methods-from-project

Union-Find

0130-surrounded-regions
0200-number-of-islands
0785-is-graph-bipartite
1631-path-with-minimum-effort
2685-count-the-number-of-complete-components
2812-find-the-safest-path-in-a-grid
3532-path-existence-queries-in-a-graph-i

Dynamic Programming

0005-longest-palindromic-substring
0022-generate-parentheses
0053-maximum-subarray
0055-jump-game
0062-unique-paths
0070-climbing-stairs
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0123-best-time-to-buy-and-sell-stock-iii
0188-best-time-to-buy-and-sell-stock-iv
0198-house-robber
0300-longest-increasing-subsequence
0322-coin-change
0416-partition-equal-subset-sum
0486-predict-the-winner
0494-target-sum
0509-fibonacci-number
0787-cheapest-flights-within-k-stops
0877-stone-game
1143-longest-common-subsequence
1301-number-of-paths-with-max-score
1406-stone-game-iii
1510-stone-game-iv
1547-minimum-cost-to-cut-a-stick
1563-stone-game-v
3302-find-the-lexicographically-smallest-valid-sequence
3534-path-existence-queries-in-a-graph-ii
3620-network-recovery-pathways

Graph Theory

0743-network-delay-time
0785-is-graph-bipartite
0787-cheapest-flights-within-k-stops
2685-count-the-number-of-complete-components
3310-remove-methods-from-project
3532-path-existence-queries-in-a-graph-i
3534-path-existence-queries-in-a-graph-ii
3620-network-recovery-pathways

Topological Sort

3620-network-recovery-pathways

Shortest Path

0743-network-delay-time
0787-cheapest-flights-within-k-stops
3620-network-recovery-pathways

Quickselect

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

Bucket Sort

0347-top-k-frequent-elements
0692-top-k-frequent-words

Counting

0169-majority-element
0229-majority-element-ii
0347-top-k-frequent-elements
0621-task-scheduler
0692-top-k-frequent-words
0767-reorganize-string
2029-stone-game-ix
3720-lexicographically-smallest-permutation-greater-than-target

Trie

0692-top-k-frequent-words

Math

0062-unique-paths
0070-climbing-stairs
0486-predict-the-winner
0509-fibonacci-number
0628-maximum-product-of-three-numbers
0877-stone-game
1406-stone-game-iii
1510-stone-game-iv
1563-stone-game-v
1927-sum-game
1979-find-greatest-common-divisor-of-array
2029-stone-game-ix
3014-minimum-number-of-pushes-to-type-word-i
3116-kth-smallest-amount-with-single-denomination-combination
3348-smallest-divisible-digit-product-ii
3513-number-of-unique-xor-triplets-i
3514-number-of-unique-xor-triplets-ii
3622-check-divisibility-by-digit-sum-and-product
3658-gcd-of-odd-and-even-sums
3754-concatenate-non-zero-digits-and-multiply-by-sum-i
3756-concatenate-non-zero-digits-and-multiply-by-sum-ii
3867-sum-of-gcd-of-formed-pairs

Recursion

0486-predict-the-winner
0509-fibonacci-number

Memoization

0070-climbing-stairs
0509-fibonacci-number

Backtracking

0017-letter-combinations-of-a-phone-number
0022-generate-parentheses
0039-combination-sum
0093-restore-ip-addresses
0113-path-sum-ii
0494-target-sum
3348-smallest-divisible-digit-product-ii

Stack

0094-binary-tree-inorder-traversal
0739-daily-temperatures

Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0099-recover-binary-search-tree
0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0107-binary-tree-level-order-traversal-ii
0112-path-sum
0113-path-sum-ii
0129-sum-root-to-leaf-numbers
0226-invert-binary-tree
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
0653-two-sum-iv-input-is-a-bst
0700-search-in-a-binary-search-tree
0951-flip-equivalent-binary-trees
0958-check-completeness-of-a-binary-tree

Depth-First Search

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0099-recover-binary-search-tree
0100-same-tree
0101-symmetric-tree
0112-path-sum
0113-path-sum-ii
0129-sum-root-to-leaf-numbers
0130-surrounded-regions
0200-number-of-islands
0226-invert-binary-tree
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
0653-two-sum-iv-input-is-a-bst
0743-network-delay-time
0785-is-graph-bipartite
0787-cheapest-flights-within-k-stops
0951-flip-equivalent-binary-trees
1631-path-with-minimum-effort
2685-count-the-number-of-complete-components
3310-remove-methods-from-project

Binary Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0099-recover-binary-search-tree
0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0107-binary-tree-level-order-traversal-ii
0112-path-sum
0113-path-sum-ii
0129-sum-root-to-leaf-numbers
0226-invert-binary-tree
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
0653-two-sum-iv-input-is-a-bst
0700-search-in-a-binary-search-tree
0951-flip-equivalent-binary-trees
0958-check-completeness-of-a-binary-tree

Bit Manipulation

0136-single-number
0191-number-of-1-bits
1386-cinema-seat-allocation
3116-kth-smallest-amount-with-single-denomination-combination
3513-number-of-unique-xor-triplets-i
3514-number-of-unique-xor-triplets-ii
3534-path-existence-queries-in-a-graph-ii
3702-longest-subsequence-with-non-zero-bitwise-xor

String Matching

0572-subtree-of-another-tree

Hash Function

0572-subtree-of-another-tree

Binary Search Tree

0098-validate-binary-search-tree
0099-recover-binary-search-tree
0235-lowest-common-ancestor-of-a-binary-search-tree
0653-two-sum-iv-input-is-a-bst
0700-search-in-a-binary-search-tree

Number Theory

1979-find-greatest-common-divisor-of-array
3116-kth-smallest-amount-with-single-denomination-combination
3348-smallest-divisible-digit-product-ii
3658-gcd-of-odd-and-even-sums
3867-sum-of-gcd-of-formed-pairs

Simulation

1260-shift-2d-grid
3069-distribute-elements-into-two-arrays-i
3867-sum-of-gcd-of-formed-pairs

Game Theory

0486-predict-the-winner
0877-stone-game
1406-stone-game-iii
1510-stone-game-iv
1563-stone-game-v
1927-sum-game
2029-stone-game-ix

Minimax

1406-stone-game-iii
1510-stone-game-iv
2029-stone-game-ix

Zero-Sum Game

1406-stone-game-iii
1510-stone-game-iv
2029-stone-game-ix

Knapsack Problem

0322-coin-change
0416-partition-equal-subset-sum
0494-target-sum

0-1 Knapsack

0416-partition-equal-subset-sum
0494-target-sum

Longest Increasing Subsequence

0300-longest-increasing-subsequence

Nim Game

1510-stone-game-iv
2029-stone-game-ix

Sprague–Grundy Theorem

1510-stone-game-iv

Longest Common Subsequence

1143-longest-common-subsequence

Combinatorics

0062-unique-paths
3116-kth-smallest-amount-with-single-denomination-combination

Sliding Window

1652-defuse-the-bomb
2958-length-of-longest-subarray-with-at-most-k-frequency
3090-maximum-length-substring-with-two-occurrences

Ordered Set

2213-longest-substring-of-one-repeating-character

Quicksort

0455-assign-cookies

Manacher

0005-longest-palindromic-substring

Database

1757-recyclable-and-low-fat-products

Boyer–Moore Majority Vote Algorithm

0169-majority-element
0229-majority-element-ii

Bracket Sequences

0022-generate-parentheses

Complete Knapsack

0322-coin-change

Monotonic Stack

0739-daily-temperatures

About

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

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages