Skip to content

Latest commit

 

History

588 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode-submissions

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

LeetCode Topics

Array

0001-two-sum
0014-longest-common-prefix
0015-3sum
0016-3sum-closest
0026-remove-duplicates-from-sorted-array
0027-remove-element
0031-next-permutation
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0045-jump-game-ii
0055-jump-game
0066-plus-one
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0150-evaluate-reverse-polish-notation
0153-find-minimum-in-rotated-sorted-array
0154-find-minimum-in-rotated-sorted-array-ii
0198-house-robber
0200-number-of-islands
0416-partition-equal-subset-sum
0486-predict-the-winner
0494-target-sum
0496-next-greater-element-i
0503-next-greater-element-ii
0560-subarray-sum-equals-k
0704-binary-search
0705-design-hashset
0706-design-hashmap
0877-stone-game
0994-rotting-oranges
1260-shift-2d-grid
1288-remove-covered-intervals
1301-number-of-paths-with-max-score
1306-jump-game-iii
1331-rank-transform-of-an-array
1345-jump-game-iv
1464-maximum-product-of-two-elements-in-an-array
1752-check-if-array-is-sorted-and-rotated
1846-maximum-element-after-decreasing-and-rearranging
1967-number-of-strings-that-appear-as-substrings-in-word
1979-find-greatest-common-divisor-of-array
2161-partition-array-according-to-given-pivot
2196-create-binary-tree-from-descriptions
2540-minimum-common-value
2574-left-and-right-sum-differences
2657-find-the-prefix-common-array-of-two-arrays
2784-check-if-array-is-good
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
3005-count-elements-with-maximum-frequency
3042-count-prefix-and-suffix-pairs-i
3043-find-the-length-of-the-longest-common-prefix
3045-count-prefix-and-suffix-pairs-ii
3159-find-occurrences-of-an-element-in-an-array
3286-find-a-safe-walk-through-a-grid
3312-sorted-gcd-pair-queries
3336-find-the-number-of-subsequences-with-equal-gcd
3501-maximize-active-section-with-trade-ii
3513-number-of-unique-xor-triplets-i
3524-find-x-value-of-array-i
3532-path-existence-queries-in-a-graph-i
3534-path-existence-queries-in-a-graph-ii
3620-network-recovery-pathways
3689-maximum-total-subarray-value-i
3691-maximum-total-subarray-value-ii
3693-climbing-stairs-ii
3838-weighted-word-mapping
3867-sum-of-gcd-of-formed-pairs

Hash Table

0001-two-sum
0012-integer-to-roman
0017-letter-combinations-of-a-phone-number
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0205-isomorphic-strings
0496-next-greater-element-i
0560-subarray-sum-equals-k
0705-design-hashset
0706-design-hashmap
1331-rank-transform-of-an-array
1345-jump-game-iv
1358-number-of-substrings-containing-all-three-characters
2196-create-binary-tree-from-descriptions
2540-minimum-common-value
2657-find-the-prefix-common-array-of-two-arrays
2784-check-if-array-is-good
2958-length-of-longest-subarray-with-at-most-k-frequency
2996-smallest-missing-integer-greater-than-sequential-prefix-sum
3005-count-elements-with-maximum-frequency
3016-minimum-number-of-pushes-to-type-word-ii
3043-find-the-length-of-the-longest-common-prefix
3090-maximum-length-substring-with-two-occurrences
3159-find-occurrences-of-an-element-in-an-array
3312-sorted-gcd-pair-queries
3325-count-substrings-with-k-frequency-characters-i
3518-smallest-palindromic-rearrangement-ii
3532-path-existence-queries-in-a-graph-i

Sorting

0015-3sum
0016-3sum-closest
1288-remove-covered-intervals
1331-rank-transform-of-an-array
1464-maximum-product-of-two-elements-in-an-array
1846-maximum-element-after-decreasing-and-rearranging
2784-check-if-array-is-good
2996-smallest-missing-integer-greater-than-sequential-prefix-sum
3016-minimum-number-of-pushes-to-type-word-ii
3517-smallest-palindromic-rearrangement-i
3534-path-existence-queries-in-a-graph-ii
3536-maximum-product-of-two-digits
3867-sum-of-gcd-of-formed-pairs

Binary Search

0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0069-sqrtx
0153-find-minimum-in-rotated-sorted-array
0154-find-minimum-in-rotated-sorted-array-ii
0704-binary-search
2540-minimum-common-value
2812-find-the-safest-path-in-a-grid
3312-sorted-gcd-pair-queries
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

Dynamic Programming

0005-longest-palindromic-substring
0022-generate-parentheses
0045-jump-game-ii
0055-jump-game
0070-climbing-stairs
0097-interleaving-string
0198-house-robber
0416-partition-equal-subset-sum
0486-predict-the-winner
0494-target-sum
0509-fibonacci-number
0678-valid-parenthesis-string
0877-stone-game
1143-longest-common-subsequence
1301-number-of-paths-with-max-score
3336-find-the-number-of-subsequences-with-equal-gcd
3524-find-x-value-of-array-i
3534-path-existence-queries-in-a-graph-ii
3620-network-recovery-pathways
3693-climbing-stairs-ii

Greedy

0045-jump-game-ii
0055-jump-game
0678-valid-parenthesis-string
1081-smallest-subsequence-of-distinct-characters
1846-maximum-element-after-decreasing-and-rearranging
3014-minimum-number-of-pushes-to-type-word-i
3016-minimum-number-of-pushes-to-type-word-ii
3534-path-existence-queries-in-a-graph-ii
3689-maximum-total-subarray-value-i
3691-maximum-total-subarray-value-ii

Depth-First Search

0094-binary-tree-inorder-traversal
0100-same-tree
0101-symmetric-tree
0144-binary-tree-preorder-traversal
0200-number-of-islands
0226-invert-binary-tree
0572-subtree-of-another-tree
1306-jump-game-iii
2492-minimum-score-of-a-path-between-two-cities
2685-count-the-number-of-complete-components
3310-remove-methods-from-project
3558-number-of-ways-to-assign-edge-weights-i

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0200-number-of-islands
0226-invert-binary-tree
0994-rotting-oranges
1306-jump-game-iii
1345-jump-game-iv
2492-minimum-score-of-a-path-between-two-cities
2685-count-the-number-of-complete-components
2812-find-the-safest-path-in-a-grid
3286-find-a-safe-walk-through-a-grid
3310-remove-methods-from-project

Tree

0094-binary-tree-inorder-traversal
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
0144-binary-tree-preorder-traversal
0226-invert-binary-tree
0572-subtree-of-another-tree
2196-create-binary-tree-from-descriptions
3558-number-of-ways-to-assign-edge-weights-i

String Matching

0005-longest-palindromic-substring
0006-zigzag-conversion
0012-integer-to-roman
0014-longest-common-prefix
0017-letter-combinations-of-a-phone-number
0020-valid-parentheses
0022-generate-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0043-multiply-strings
0058-length-of-last-word
0067-add-binary
0097-interleaving-string
0125-valid-palindrome
0151-reverse-words-in-a-string
0205-isomorphic-strings
0344-reverse-string
0415-add-strings
0572-subtree-of-another-tree
0678-valid-parenthesis-string
0844-backspace-string-compare
1081-smallest-subsequence-of-distinct-characters
1143-longest-common-subsequence
1358-number-of-substrings-containing-all-three-characters
1967-number-of-strings-that-appear-as-substrings-in-word
3014-minimum-number-of-pushes-to-type-word-i
3016-minimum-number-of-pushes-to-type-word-ii
3042-count-prefix-and-suffix-pairs-i
3043-find-the-length-of-the-longest-common-prefix
3045-count-prefix-and-suffix-pairs-ii
3090-maximum-length-substring-with-two-occurrences
3325-count-substrings-with-k-frequency-characters-i
3499-maximize-active-section-with-trade-i
3501-maximize-active-section-with-trade-ii
3517-smallest-palindromic-rearrangement-i
3518-smallest-palindromic-rearrangement-ii
3612-process-string-with-special-operations-i
3756-concatenate-non-zero-digits-and-multiply-by-sum-ii
3838-weighted-word-mapping

Binary Tree

0094-binary-tree-inorder-traversal
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
0144-binary-tree-preorder-traversal
0226-invert-binary-tree
0572-subtree-of-another-tree
2196-create-binary-tree-from-descriptions

Hash Function

0572-subtree-of-another-tree
0705-design-hashset
0706-design-hashmap
3042-count-prefix-and-suffix-pairs-i
3045-count-prefix-and-suffix-pairs-ii

Two Pointers

0005-longest-palindromic-substring
0015-3sum
0016-3sum-closest
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
0031-next-permutation
0125-valid-palindrome
0151-reverse-words-in-a-string
0344-reverse-string
0844-backspace-string-compare
2095-delete-the-middle-node-of-a-linked-list
2130-maximum-twin-sum-of-a-linked-list
2161-partition-array-according-to-given-pivot
2540-minimum-common-value
3534-path-existence-queries-in-a-graph-ii
3867-sum-of-gcd-of-formed-pairs

Bit Manipulation

0029-divide-two-integers
0067-add-binary
2657-find-the-prefix-common-array-of-two-arrays
3513-number-of-unique-xor-triplets-i
3534-path-existence-queries-in-a-graph-ii

Trie

0014-longest-common-prefix
3042-count-prefix-and-suffix-pairs-i
3043-find-the-length-of-the-longest-common-prefix
3045-count-prefix-and-suffix-pairs-ii

Prefix Sum

0560-subarray-sum-equals-k
2574-left-and-right-sum-differences
3312-sorted-gcd-pair-queries
3756-concatenate-non-zero-digits-and-multiply-by-sum-ii

Simulation

0043-multiply-strings
0067-add-binary
0415-add-strings
0844-backspace-string-compare
1260-shift-2d-grid
2161-partition-array-according-to-given-pivot
3612-process-string-with-special-operations-i
3838-weighted-word-mapping
3867-sum-of-gcd-of-formed-pairs

Math

0002-add-two-numbers
0007-reverse-integer
0009-palindrome-number
0012-integer-to-roman
0029-divide-two-integers
0043-multiply-strings
0050-powx-n
0066-plus-one
0067-add-binary
0069-sqrtx
0070-climbing-stairs
0150-evaluate-reverse-polish-notation
0415-add-strings
0486-predict-the-winner
0509-fibonacci-number
0877-stone-game
1979-find-greatest-common-divisor-of-array
3014-minimum-number-of-pushes-to-type-word-i
3312-sorted-gcd-pair-queries
3336-find-the-number-of-subsequences-with-equal-gcd
3345-smallest-divisible-digit-product-i
3513-number-of-unique-xor-triplets-i
3518-smallest-palindromic-rearrangement-ii
3524-find-x-value-of-array-i
3536-maximum-product-of-two-digits
3558-number-of-ways-to-assign-edge-weights-i
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

Segment Tree

3501-maximize-active-section-with-trade-ii
3691-maximum-total-subarray-value-ii

Heap (Priority Queue)

0023-merge-k-sorted-lists
1464-maximum-product-of-two-elements-in-an-array
2812-find-the-safest-path-in-a-grid
3286-find-a-safe-walk-through-a-grid
3620-network-recovery-pathways
3691-maximum-total-subarray-value-ii

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
0025-reverse-nodes-in-k-group
0083-remove-duplicates-from-sorted-list
0203-remove-linked-list-elements
0206-reverse-linked-list
0705-design-hashset
0706-design-hashmap
2095-delete-the-middle-node-of-a-linked-list
2130-maximum-twin-sum-of-a-linked-list

Stack

0020-valid-parentheses
0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0150-evaluate-reverse-polish-notation
0496-next-greater-element-i
0503-next-greater-element-ii
0678-valid-parenthesis-string
0844-backspace-string-compare
1081-smallest-subsequence-of-distinct-characters
2130-maximum-twin-sum-of-a-linked-list

Backtracking

0017-letter-combinations-of-a-phone-number
0022-generate-parentheses
0494-target-sum

Sliding Window

1358-number-of-substrings-containing-all-three-characters
2958-length-of-longest-subarray-with-at-most-k-frequency
3090-maximum-length-substring-with-two-occurrences
3325-count-substrings-with-k-frequency-characters-i

Union-Find

0200-number-of-islands
2492-minimum-score-of-a-path-between-two-cities
2685-count-the-number-of-complete-components
2812-find-the-safest-path-in-a-grid
3532-path-existence-queries-in-a-graph-i

Matrix

0200-number-of-islands
0994-rotting-oranges
1260-shift-2d-grid
1301-number-of-paths-with-max-score
2812-find-the-safest-path-in-a-grid
3286-find-a-safe-walk-through-a-grid

Graph Theory

2492-minimum-score-of-a-path-between-two-cities
2685-count-the-number-of-complete-components
3286-find-a-safe-walk-through-a-grid
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

Shortest Path

3286-find-a-safe-walk-through-a-grid
3620-network-recovery-pathways

Design

0705-design-hashset
0706-design-hashmap

Counting

3005-count-elements-with-maximum-frequency
3016-minimum-number-of-pushes-to-type-word-ii
3312-sorted-gcd-pair-queries
3518-smallest-palindromic-rearrangement-ii

Rolling Hash

3042-count-prefix-and-suffix-pairs-i
3045-count-prefix-and-suffix-pairs-ii

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists
0024-swap-nodes-in-pairs
0025-reverse-nodes-in-k-group
0050-powx-n
0203-remove-linked-list-elements
0206-reverse-linked-list
0486-predict-the-winner
0509-fibonacci-number

Enumeration

1291-sequential-digits
3345-smallest-divisible-digit-product-i
3499-maximize-active-section-with-trade-i

Number Theory

1979-find-greatest-common-divisor-of-array
3312-sorted-gcd-pair-queries
3336-find-the-number-of-subsequences-with-equal-gcd
3658-gcd-of-odd-and-even-sums
3867-sum-of-gcd-of-formed-pairs

Divide and Conquer

0023-merge-k-sorted-lists
0105-construct-binary-tree-from-preorder-and-inorder-traversal

Merge Sort

0023-merge-k-sorted-lists

Combinatorics

3312-sorted-gcd-pair-queries
3518-smallest-palindromic-rearrangement-ii

Monotonic Stack

0496-next-greater-element-i
0503-next-greater-element-ii
1081-smallest-subsequence-of-distinct-characters

Memoization

0070-climbing-stairs
0509-fibonacci-number

Counting Sort

3517-smallest-palindromic-rearrangement-i

Topological Sort

3620-network-recovery-pathways

Game Theory

0486-predict-the-winner
0877-stone-game

Bracket Sequences

0678-valid-parenthesis-string

Knapsack Problem

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

0-1 Knapsack

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

Longest Common Subsequence

1143-longest-common-subsequence

About

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

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages