Skip to content
AyushDey10Public

About

A collection of LeetCode questions to ace the coding interview!

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

633 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test

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

LeetCode Topics

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0453-minimum-moves-to-equal-array-elements
0462-minimum-moves-to-equal-array-elements-ii
0486-predict-the-winner
0835-image-overlap
0877-stone-game
1140-stone-game-ii
1254-number-of-closed-islands
1386-cinema-seat-allocation
1406-stone-game-iii
1477-find-two-non-overlapping-sub-arrays-each-with-target-sum
1524-number-of-sub-arrays-with-odd-sum
1563-stone-game-v
1569-number-of-ways-to-reorder-array-to-get-same-bst
1606-find-servers-that-handled-most-number-of-requests
1658-minimum-operations-to-reduce-x-to-zero
1807-evaluate-the-bracket-pairs-of-a-string
1872-stone-game-viii
2029-stone-game-ix
2089-find-target-indices-after-sorting-array
2091-removing-minimum-and-maximum-from-array
2213-longest-substring-of-one-repeating-character
2267-check-if-there-is-a-valid-parentheses-string-path
2333-minimum-sum-of-squared-difference
2747-count-zero-request-servers
2778-sum-of-squares-of-special-elements
2897-apply-operations-on-array-to-maximize-sum-of-squares
2913-subarrays-distinct-element-sum-of-squares-i
2916-subarrays-distinct-element-sum-of-squares-ii
2948-make-lexicographically-smallest-array-by-swapping-elements
2958-length-of-longest-subarray-with-at-most-k-frequency
2996-smallest-missing-integer-greater-than-sequential-prefix-sum
3069-distribute-elements-into-two-arrays-i
3105-longest-strictly-increasing-or-strictly-decreasing-subarray
3364-minimum-positive-sum-subarray
3414-maximum-score-of-non-overlapping-intervals
3420-count-non-decreasing-subarrays-after-k-operations
3471-find-the-largest-almost-missing-integer
3483-unique-3-digit-even-numbers
3505-minimum-operations-to-make-elements-within-k-subarrays-equal
3524-find-x-value-of-array-i
3525-find-x-value-of-array-ii
3550-smallest-index-with-digit-sum-equal-to-index
3551-minimum-swaps-to-sort-by-digit-sum
3568-minimum-moves-to-clean-the-classroom
3619-count-islands-with-total-value-divisible-by-k
3644-maximum-k-to-sort-a-permutation
3665-twisted-mirror-path-count
3702-longest-subsequence-with-non-zero-bitwise-xor
3727-maximum-alternating-sum-of-squares
3731-find-missing-elements
3736-minimum-moves-to-equal-array-elements-iii
3841-palindromic-path-queries-in-a-tree
3875-construct-uniform-parity-array-i
3876-construct-uniform-parity-array-ii
3882-minimum-xor-path-in-a-grid
3886-sum-of-sortable-integers
3903-smallest-stable-index-i
3904-smallest-stable-index-ii
3942-minimum-operations-to-sort-a-permutation

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0013-roman-to-integer
1096-brace-expansion-ii
1386-cinema-seat-allocation
1477-find-two-non-overlapping-sub-arrays-each-with-target-sum
1520-maximum-number-of-non-overlapping-substrings
1658-minimum-operations-to-reduce-x-to-zero
1807-evaluate-the-bracket-pairs-of-a-string
2747-count-zero-request-servers
2897-apply-operations-on-array-to-maximize-sum-of-squares
2913-subarrays-distinct-element-sum-of-squares-i
2916-subarrays-distinct-element-sum-of-squares-ii
2958-length-of-longest-subarray-with-at-most-k-frequency
2996-smallest-missing-integer-greater-than-sequential-prefix-sum
3090-maximum-length-substring-with-two-occurrences
3471-find-the-largest-almost-missing-integer
3483-unique-3-digit-even-numbers
3505-minimum-operations-to-make-elements-within-k-subarrays-equal
3551-minimum-swaps-to-sort-by-digit-sum
3568-minimum-moves-to-clean-the-classroom
3731-find-missing-elements

Linked List

0002-add-two-numbers

Math

0002-add-two-numbers
0007-reverse-integer
0009-palindrome-number
0013-roman-to-integer
0453-minimum-moves-to-equal-array-elements
0462-minimum-moves-to-equal-array-elements-ii
0486-predict-the-winner
0836-rectangle-overlap
0877-stone-game
1140-stone-game-ii
1401-circle-and-rectangle-overlapping
1406-stone-game-iii
1510-stone-game-iv
1524-number-of-sub-arrays-with-odd-sum
1563-stone-game-v
1569-number-of-ways-to-reorder-array-to-get-same-bst
1621-number-of-sets-of-k-non-overlapping-line-segments
1872-stone-game-viii
1927-sum-game
2029-stone-game-ix
2409-count-days-spent-together
3014-minimum-number-of-pushes-to-type-word-i
3345-smallest-divisible-digit-product-i
3348-smallest-divisible-digit-product-ii
3505-minimum-operations-to-make-elements-within-k-subarrays-equal
3524-find-x-value-of-array-i
3525-find-x-value-of-array-ii
3550-smallest-index-with-digit-sum-equal-to-index
3622-check-divisibility-by-digit-sum-and-product
3723-maximize-sum-of-squares-of-digits
3736-minimum-moves-to-equal-array-elements-iii
3789-minimum-cost-to-acquire-required-items
3870-count-commas-in-range
3871-count-commas-in-range-ii
3875-construct-uniform-parity-array-i
3876-construct-uniform-parity-array-ii
3886-sum-of-sortable-integers

Recursion

0002-add-two-numbers
0010-regular-expression-matching
0486-predict-the-winner
3483-unique-3-digit-even-numbers

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0006-zigzag-conversion
0008-string-to-integer-atoi
0010-regular-expression-matching
0013-roman-to-integer
0020-valid-parentheses
0022-generate-parentheses
0032-longest-valid-parentheses
0115-distinct-subsequences
0301-remove-invalid-parentheses
0678-valid-parenthesis-string
0856-score-of-parentheses
0921-minimum-add-to-make-parentheses-valid
0940-distinct-subsequences-ii
1021-remove-outermost-parentheses
1096-brace-expansion-ii
1111-maximum-nesting-depth-of-two-valid-parentheses-strings
1190-reverse-substrings-between-each-pair-of-parentheses
1520-maximum-number-of-non-overlapping-substrings
1541-minimum-insertions-to-balance-a-parentheses-string
1614-maximum-nesting-depth-of-the-parentheses
1807-evaluate-the-bracket-pairs-of-a-string
1927-sum-game
2213-longest-substring-of-one-repeating-character
2243-calculate-digit-sum-of-a-string
2409-count-days-spent-together
2472-maximum-number-of-non-overlapping-palindrome-substrings
2911-minimum-changes-to-make-k-semi-palindromes
2914-minimum-number-of-changes-to-make-binary-string-beautiful
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
3498-reverse-degree-of-a-string
3841-palindromic-path-queries-in-a-tree
3863-minimum-operations-to-sort-a-string
3970-shortest-path-with-at-most-k-consecutive-identical-characters

Sliding Window

0003-longest-substring-without-repeating-characters
1477-find-two-non-overlapping-sub-arrays-each-with-target-sum
1658-minimum-operations-to-reduce-x-to-zero
2747-count-zero-request-servers
2958-length-of-longest-subarray-with-at-most-k-frequency
3090-maximum-length-substring-with-two-occurrences
3364-minimum-positive-sum-subarray
3420-count-non-decreasing-subarrays-after-k-operations
3505-minimum-operations-to-make-elements-within-k-subarrays-equal

Binary Search

0004-median-of-two-sorted-arrays
1477-find-two-non-overlapping-sub-arrays-each-with-target-sum
1658-minimum-operations-to-reduce-x-to-zero
2089-find-target-indices-after-sorting-array
2333-minimum-sum-of-squared-difference
3414-maximum-score-of-non-overlapping-intervals

Divide and Conquer

0004-median-of-two-sorted-arrays
1569-number-of-ways-to-reorder-array-to-get-same-bst
3841-palindromic-path-queries-in-a-tree

Two Pointers

0005-longest-palindromic-substring
2472-maximum-number-of-non-overlapping-palindrome-substrings
2911-minimum-changes-to-make-k-semi-palindromes
3302-find-the-lexicographically-smallest-valid-sequence

Dynamic Programming

0005-longest-palindromic-substring
0010-regular-expression-matching
0022-generate-parentheses
0032-longest-valid-parentheses
0115-distinct-subsequences
0486-predict-the-winner
0678-valid-parenthesis-string
0877-stone-game
0940-distinct-subsequences-ii
1140-stone-game-ii
1406-stone-game-iii
1477-find-two-non-overlapping-sub-arrays-each-with-target-sum
1510-stone-game-iv
1524-number-of-sub-arrays-with-odd-sum
1563-stone-game-v
1569-number-of-ways-to-reorder-array-to-get-same-bst
1621-number-of-sets-of-k-non-overlapping-line-segments
1872-stone-game-viii
2267-check-if-there-is-a-valid-parentheses-string-path
2472-maximum-number-of-non-overlapping-palindrome-substrings
2911-minimum-changes-to-make-k-semi-palindromes
3302-find-the-lexicographically-smallest-valid-sequence
3414-maximum-score-of-non-overlapping-intervals
3505-minimum-operations-to-make-elements-within-k-subarrays-equal
3524-find-x-value-of-array-i
3665-twisted-mirror-path-count
3882-minimum-xor-path-in-a-grid

Game Theory

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

Minimax

1140-stone-game-ii
1406-stone-game-iii
1510-stone-game-iv
1872-stone-game-viii
2029-stone-game-ix

Zero-Sum Game

1140-stone-game-ii
1406-stone-game-iii
1510-stone-game-iv
1872-stone-game-viii
2029-stone-game-ix

Sorting

0462-minimum-moves-to-equal-array-elements-ii
1096-brace-expansion-ii
1520-maximum-number-of-non-overlapping-substrings
2089-find-target-indices-after-sorting-array
2333-minimum-sum-of-squared-difference
2747-count-zero-request-servers
2948-make-lexicographically-smallest-array-by-swapping-elements
2996-smallest-missing-integer-greater-than-sequential-prefix-sum
3414-maximum-score-of-non-overlapping-intervals
3551-minimum-swaps-to-sort-by-digit-sum
3727-maximum-alternating-sum-of-squares
3731-find-missing-elements
3886-sum-of-sortable-integers

Depth-First Search

1254-number-of-closed-islands
2265-count-nodes-equal-to-average-of-subtree
3310-remove-methods-from-project
3619-count-islands-with-total-value-divisible-by-k
3841-palindromic-path-queries-in-a-tree

Breadth-First Search

0301-remove-invalid-parentheses
1096-brace-expansion-ii
1254-number-of-closed-islands
3310-remove-methods-from-project
3568-minimum-moves-to-clean-the-classroom
3619-count-islands-with-total-value-divisible-by-k

Graph Theory

3310-remove-methods-from-project
3970-shortest-path-with-at-most-k-consecutive-identical-characters

Enumeration

2778-sum-of-squares-of-special-elements
3345-smallest-divisible-digit-product-i
3483-unique-3-digit-even-numbers
3886-sum-of-sortable-integers

Backtracking

0022-generate-parentheses
0301-remove-invalid-parentheses
1096-brace-expansion-ii
3348-smallest-divisible-digit-product-ii

Greedy

0678-valid-parenthesis-string
0921-minimum-add-to-make-parentheses-valid
1386-cinema-seat-allocation
1520-maximum-number-of-non-overlapping-substrings
1541-minimum-insertions-to-balance-a-parentheses-string
1927-sum-game
2029-stone-game-ix
2091-removing-minimum-and-maximum-from-array
2333-minimum-sum-of-squared-difference
2472-maximum-number-of-non-overlapping-palindrome-substrings
2897-apply-operations-on-array-to-maximize-sum-of-squares
3014-minimum-number-of-pushes-to-type-word-i
3302-find-the-lexicographically-smallest-valid-sequence
3348-smallest-divisible-digit-product-ii
3723-maximize-sum-of-squares-of-digits
3727-maximum-alternating-sum-of-squares
3789-minimum-cost-to-acquire-required-items

Number Theory

3348-smallest-divisible-digit-product-ii

Prefix Sum

1140-stone-game-ii
1524-number-of-sub-arrays-with-odd-sum
1621-number-of-sets-of-k-non-overlapping-line-segments
1658-minimum-operations-to-reduce-x-to-zero
1872-stone-game-viii
3364-minimum-positive-sum-subarray
3903-smallest-stable-index-i
3904-smallest-stable-index-ii

Nim Game

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

Sprague–Grundy Theorem

1510-stone-game-iv

Segment Tree

2213-longest-substring-of-one-repeating-character
2913-subarrays-distinct-element-sum-of-squares-i
2916-subarrays-distinct-element-sum-of-squares-ii
3420-count-non-decreasing-subarrays-after-k-operations
3525-find-x-value-of-array-ii
3841-palindromic-path-queries-in-a-tree

Ordered Set

1606-find-servers-that-handled-most-number-of-requests
2213-longest-substring-of-one-repeating-character

Bit Manipulation

1386-cinema-seat-allocation
2897-apply-operations-on-array-to-maximize-sum-of-squares
3568-minimum-moves-to-clean-the-classroom
3644-maximum-k-to-sort-a-permutation
3702-longest-subsequence-with-non-zero-bitwise-xor
3841-palindromic-path-queries-in-a-tree
3882-minimum-xor-path-in-a-grid

Counting

2029-stone-game-ix

Simulation

1606-find-servers-that-handled-most-number-of-requests
2243-calculate-digit-sum-of-a-string
3069-distribute-elements-into-two-arrays-i
3498-reverse-degree-of-a-string

Union-Find

1254-number-of-closed-islands
1569-number-of-ways-to-reorder-array-to-get-same-bst
2948-make-lexicographically-smallest-array-by-swapping-elements
3619-count-islands-with-total-value-divisible-by-k

Matrix

0835-image-overlap
1254-number-of-closed-islands
2267-check-if-there-is-a-valid-parentheses-string-path
3568-minimum-moves-to-clean-the-classroom
3619-count-islands-with-total-value-divisible-by-k
3665-twisted-mirror-path-count
3882-minimum-xor-path-in-a-grid

Tree

1569-number-of-ways-to-reorder-array-to-get-same-bst
2265-count-nodes-equal-to-average-of-subtree
3841-palindromic-path-queries-in-a-tree

Binary Tree

1569-number-of-ways-to-reorder-array-to-get-same-bst
2265-count-nodes-equal-to-average-of-subtree

Geometry

0836-rectangle-overlap
1401-circle-and-rectangle-overlapping

Combinatorics

1569-number-of-ways-to-reorder-array-to-get-same-bst
1621-number-of-sets-of-k-non-overlapping-line-segments

Stack

0020-valid-parentheses
0032-longest-valid-parentheses
0678-valid-parenthesis-string
0856-score-of-parentheses
0921-minimum-add-to-make-parentheses-valid
1021-remove-outermost-parentheses
1096-brace-expansion-ii
1111-maximum-nesting-depth-of-two-valid-parentheses-strings
1190-reverse-substrings-between-each-pair-of-parentheses
1541-minimum-insertions-to-balance-a-parentheses-string
1614-maximum-nesting-depth-of-the-parentheses
3420-count-non-decreasing-subarrays-after-k-operations

Bracket Sequences

0020-valid-parentheses
0022-generate-parentheses
0032-longest-valid-parentheses
0678-valid-parenthesis-string
0856-score-of-parentheses
0921-minimum-add-to-make-parentheses-valid
1021-remove-outermost-parentheses
1111-maximum-nesting-depth-of-two-valid-parentheses-strings
1190-reverse-substrings-between-each-pair-of-parentheses
1541-minimum-insertions-to-balance-a-parentheses-string
1614-maximum-nesting-depth-of-the-parentheses
2267-check-if-there-is-a-valid-parentheses-string-path

Heap (Priority Queue)

1606-find-servers-that-handled-most-number-of-requests
2333-minimum-sum-of-squared-difference
3505-minimum-operations-to-make-elements-within-k-subarrays-equal
3970-shortest-path-with-at-most-k-consecutive-identical-characters

Binary Indexed Tree

2913-subarrays-distinct-element-sum-of-squares-i
2916-subarrays-distinct-element-sum-of-squares-ii
3841-palindromic-path-queries-in-a-tree

Binary Search Tree

1569-number-of-ways-to-reorder-array-to-get-same-bst

Memoization

1569-number-of-ways-to-reorder-array-to-get-same-bst

Fermat's Little Theorem

1569-number-of-ways-to-reorder-array-to-get-same-bst

Shortest Path

3970-shortest-path-with-at-most-k-consecutive-identical-characters

Queue

3420-count-non-decreasing-subarrays-after-k-operations

Monotonic Stack

3420-count-non-decreasing-subarrays-after-k-operations

Monotonic Queue

3420-count-non-decreasing-subarrays-after-k-operations

About

A collection of LeetCode questions to ace the coding interview!

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages