Skip to content

manishsaini6421/leetcode-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

LeetCode Topics

Linked List

0025-reverse-nodes-in-k-group
0092-reverse-linked-list-ii
0206-reverse-linked-list
0432-all-oone-data-structure

Recursion

0025-reverse-nodes-in-k-group
0206-reverse-linked-list
1197-parsing-a-boolean-expression
1667-find-kth-bit-in-nth-binary-string

Math

0043-multiply-strings
0066-plus-one
0670-maximum-swap
1421-find-numbers-with-even-number-of-digits
1806-count-of-matches-in-tournament
2284-smallest-value-of-the-rearranged-number
2383-add-two-integers
2542-average-value-of-even-numbers-that-are-divisible-by-three
2679-count-distinct-numbers-on-board
2716-prime-subtraction-operation
3234-double-modular-exponentiation
3568-find-the-key-of-the-numbers

Array

0066-plus-one
0073-set-matrix-zeroes
0118-pascals-triangle
0169-majority-element
0179-largest-number
0216-combination-sum-iii
0229-majority-element-ii
0300-longest-increasing-subsequence
0334-increasing-triplet-subsequence
0349-intersection-of-two-arrays
0442-find-all-duplicates-in-an-array
0448-find-all-numbers-disappeared-in-an-array
0532-k-diff-pairs-in-an-array
0632-smallest-range-covering-elements-from-k-lists
0907-koko-eating-bananas
0952-word-subsets
1001-n-repeated-element-in-size-2n-array
1002-maximum-width-ramp
1055-pairs-of-songs-with-total-durations-divisible-by-60
1071-binary-prefix-divisible-by-5
1256-rank-transform-of-an-array
1335-maximum-candies-allocated-to-k-children
1350-remove-sub-folders-from-the-filesystem
1392-find-the-difference-of-two-arrays
1402-count-square-submatrices-with-all-ones
1421-find-numbers-with-even-number-of-digits
1458-sort-integers-by-the-number-of-1-bits
1468-check-if-n-and-its-double-exist
1497-design-a-stack-with-increment-operation
1524-string-matching-in-an-array
1570-final-prices-with-a-special-discount-in-a-shop
1620-check-if-array-pairs-are-divisible-by-k
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1694-make-sum-divisible-by-p
1766-minimum-number-of-removals-to-make-mountain-array
1798-max-number-of-k-sum-pairs
1886-minimum-limit-of-balls-in-a-bag
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1923-sentence-similarity-iii
1940-maximum-xor-for-each-query
2000-minimum-speed-to-arrive-on-time
2054-the-number-of-the-smallest-unoccupied-chair
2107-find-unique-binary-string
2116-count-number-of-pairs-with-absolute-difference-k
2159-two-out-of-three
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
2190-count-common-words-with-one-occurrence
2232-adding-spaces-to-a-string
2277-count-equal-and-divisible-pairs-in-an-array
2285-design-bitset
2292-counting-words-with-a-given-prefix
2294-minimum-time-to-complete-trips
2331-intersection-of-multiple-arrays
2356-largest-combination-with-bitwise-and-greater-than-zero
2465-shifting-letters-ii
2486-most-frequent-even-element
2488-divide-intervals-into-minimum-number-of-groups
2503-longest-subarray-with-maximum-bitwise-and
2542-average-value-of-even-numbers-that-are-divisible-by-three
2545-height-of-binary-tree-after-subtree-removal-queries
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
2679-count-distinct-numbers-on-board
2699-count-the-number-of-fair-pairs
2716-prime-subtraction-operation
2724-convert-an-array-into-a-2d-array-with-conditions
2727-number-of-senior-citizens
2794-maximum-number-of-moves-in-a-grid
2881-split-strings-by-separator
2917-count-pairs-whose-sum-is-less-than-target
3188-find-champion-i
3234-double-modular-exponentiation
3291-find-if-array-can-be-sorted
3309-count-prefix-and-suffix-pairs-i
3380-shortest-subarray-with-or-at-least-k-ii
3418-count-pairs-that-form-a-complete-day-ii
3427-special-array-ii
3533-snake-in-matrix

Hash Table

0073-set-matrix-zeroes
0169-majority-element
0229-majority-element-ii
0349-intersection-of-two-arrays
0432-all-oone-data-structure
0442-find-all-duplicates-in-an-array
0448-find-all-numbers-disappeared-in-an-array
0532-k-diff-pairs-in-an-array
0567-permutation-in-string
0632-smallest-range-covering-elements-from-k-lists
0896-smallest-subtree-with-all-the-deepest-nodes
0920-uncommon-words-from-two-sentences
0952-word-subsets
1001-n-repeated-element-in-size-2n-array
1055-pairs-of-songs-with-total-durations-divisible-by-60
1218-lowest-common-ancestor-of-deepest-leaves
1256-rank-transform-of-an-array
1392-find-the-difference-of-two-arrays
1468-check-if-n-and-its-double-exist
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
1798-max-number-of-k-sum-pairs
1933-number-of-different-integers-in-a-string
2054-the-number-of-the-smallest-unoccupied-chair
2059-unique-length-3-palindromic-subsequences
2107-find-unique-binary-string
2116-count-number-of-pairs-with-absolute-difference-k
2159-two-out-of-three
2190-count-common-words-with-one-occurrence
2285-design-bitset
2331-intersection-of-multiple-arrays
2356-largest-combination-with-bitwise-and-greater-than-zero
2486-most-frequent-even-element
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
2677-cousins-in-binary-tree-ii
2679-count-distinct-numbers-on-board
2724-convert-an-array-into-a-2d-array-with-conditions
3418-count-pairs-that-form-a-complete-day-ii

Divide and Conquer

0169-majority-element

Sorting

0169-majority-element
0179-largest-number
0229-majority-element-ii
0349-intersection-of-two-arrays
0532-k-diff-pairs-in-an-array
0632-smallest-range-covering-elements-from-k-lists
1256-rank-transform-of-an-array
1458-sort-integers-by-the-number-of-1-bits
1468-check-if-n-and-its-double-exist
1798-max-number-of-k-sum-pairs
1970-sorting-the-sentence
2164-two-best-non-overlapping-events
2179-most-beautiful-item-for-each-query
2284-smallest-value-of-the-rearranged-number
2331-intersection-of-multiple-arrays
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
2699-count-the-number-of-fair-pairs
2917-count-pairs-whose-sum-is-less-than-target
3291-find-if-array-can-be-sorted

Counting

0169-majority-element
0229-majority-element-ii
0920-uncommon-words-from-two-sentences
1055-pairs-of-songs-with-total-durations-divisible-by-60
1341-split-a-string-in-balanced-strings
1458-sort-integers-by-the-number-of-1-bits
1620-check-if-array-pairs-are-divisible-by-k
2116-count-number-of-pairs-with-absolute-difference-k
2190-count-common-words-with-one-occurrence
2331-intersection-of-multiple-arrays
2356-largest-combination-with-bitwise-and-greater-than-zero
2486-most-frequent-even-element
3418-count-pairs-that-form-a-complete-day-ii

String

0008-string-to-integer-atoi
0020-valid-parentheses
0043-multiply-strings
0097-interleaving-string
0179-largest-number
0567-permutation-in-string
0793-swap-adjacent-in-lr-string
0812-rotate-string
0920-uncommon-words-from-two-sentences
0952-word-subsets
0957-minimum-add-to-make-parentheses-valid
1128-remove-all-adjacent-duplicates-in-string
1197-parsing-a-boolean-expression
1302-delete-characters-to-make-fancy-string
1304-longest-happy-string
1341-split-a-string-in-balanced-strings
1350-remove-sub-folders-from-the-filesystem
1524-string-matching-in-an-array
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1667-find-kth-bit-in-nth-binary-string
1715-split-a-string-into-the-max-number-of-unique-substrings
1818-maximum-score-from-removing-substrings
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1923-sentence-similarity-iii
1933-number-of-different-integers-in-a-string
1970-sorting-the-sentence
2059-unique-length-3-palindromic-subsequences
2095-minimum-number-of-swaps-to-make-the-string-balanced
2107-find-unique-binary-string
2190-count-common-words-with-one-occurrence
2232-adding-spaces-to-a-string
2285-design-bitset
2292-counting-words-with-a-given-prefix
2414-move-pieces-to-obtain-a-string
2465-shifting-letters-ii
2580-circular-sentence
2727-number-of-senior-citizens
2800-minimum-string-length-after-removing-substrings
2881-split-strings-by-separator
3018-make-string-a-subsequence-using-cyclic-increments
3174-minimum-number-of-changes-to-make-binary-string-beautiful
3195-separate-black-and-white-balls
3309-count-prefix-and-suffix-pairs-i
3451-string-compression-iii
3533-snake-in-matrix

Two Pointers

0349-intersection-of-two-arrays
0532-k-diff-pairs-in-an-array
0567-permutation-in-string
0793-swap-adjacent-in-lr-string
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
1923-sentence-similarity-iii
2095-minimum-number-of-swaps-to-make-the-string-balanced
2232-adding-spaces-to-a-string
2414-move-pieces-to-obtain-a-string
2488-divide-intervals-into-minimum-number-of-groups
2581-divide-players-into-teams-of-equal-skill
2699-count-the-number-of-fair-pairs
2917-count-pairs-whose-sum-is-less-than-target
3018-make-string-a-subsequence-using-cyclic-increments
3195-separate-black-and-white-balls

Binary Search

0300-longest-increasing-subsequence
0349-intersection-of-two-arrays
0532-k-diff-pairs-in-an-array
0907-koko-eating-bananas
1335-maximum-candies-allocated-to-k-children
1468-check-if-n-and-its-double-exist
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
2000-minimum-speed-to-arrive-on-time
2164-two-best-non-overlapping-events
2179-most-beautiful-item-for-each-query
2188-minimized-maximum-of-products-distributed-to-any-store
2294-minimum-time-to-complete-trips
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
2716-prime-subtraction-operation
2917-count-pairs-whose-sum-is-less-than-target
3427-special-array-ii

Greedy

0179-largest-number
0334-increasing-triplet-subsequence
0632-smallest-range-covering-elements-from-k-lists
0670-maximum-swap
0957-minimum-add-to-make-parentheses-valid
1304-longest-happy-string
1341-split-a-string-in-balanced-strings
1766-minimum-number-of-removals-to-make-mountain-array
1818-maximum-score-from-removing-substrings
2095-minimum-number-of-swaps-to-make-the-string-balanced
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
2716-prime-subtraction-operation
3195-separate-black-and-white-balls

Simulation

0043-multiply-strings
1667-find-kth-bit-in-nth-binary-string
1806-count-of-matches-in-tournament
2232-adding-spaces-to-a-string
2679-count-distinct-numbers-on-board
2800-minimum-string-length-after-removing-substrings
3234-double-modular-exponentiation
3533-snake-in-matrix

Depth-First Search

0386-lexicographical-numbers
0896-smallest-subtree-with-all-the-deepest-nodes
0988-flip-equivalent-binary-trees
1035-cousins-in-binary-tree
1116-maximum-level-sum-of-a-binary-tree
1218-lowest-common-ancestor-of-deepest-leaves
1350-remove-sub-folders-from-the-filesystem
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2677-cousins-in-binary-tree-ii

Trie

0386-lexicographical-numbers
0440-k-th-smallest-in-lexicographical-order
1350-remove-sub-folders-from-the-filesystem
3309-count-prefix-and-suffix-pairs-i

Design

0432-all-oone-data-structure
1497-design-a-stack-with-increment-operation
2285-design-bitset

Doubly-Linked List

0432-all-oone-data-structure

Stack

0020-valid-parentheses
0957-minimum-add-to-make-parentheses-valid
1002-maximum-width-ramp
1128-remove-all-adjacent-duplicates-in-string
1197-parsing-a-boolean-expression
1497-design-a-stack-with-increment-operation
1570-final-prices-with-a-special-discount-in-a-shop
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1818-maximum-score-from-removing-substrings
2095-minimum-number-of-swaps-to-make-the-string-balanced
2800-minimum-string-length-after-removing-substrings

Prefix Sum

1694-make-sum-divisible-by-p
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1940-maximum-xor-for-each-query
2059-unique-length-3-palindromic-subsequences
2465-shifting-letters-ii
2488-divide-intervals-into-minimum-number-of-groups
3427-special-array-ii

Sliding Window

0567-permutation-in-string
0632-smallest-range-covering-elements-from-k-lists
3380-shortest-subarray-with-or-at-least-k-ii

Monotonic Stack

1002-maximum-width-ramp
1570-final-prices-with-a-special-discount-in-a-shop
1679-shortest-subarray-to-be-removed-to-make-array-sorted

Heap (Priority Queue)

0632-smallest-range-covering-elements-from-k-lists
1304-longest-happy-string
2054-the-number-of-the-smallest-unoccupied-chair
2164-two-best-non-overlapping-events
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations

Backtracking

0216-combination-sum-iii
1715-split-a-string-into-the-max-number-of-unique-substrings
2107-find-unique-binary-string
2170-count-number-of-maximum-bitwise-or-subsets

Bit Manipulation

1071-binary-prefix-divisible-by-5
1458-sort-integers-by-the-number-of-1-bits
1940-maximum-xor-for-each-query
2059-unique-length-3-palindromic-subsequences
2159-two-out-of-three
2170-count-number-of-maximum-bitwise-or-subsets
2356-largest-combination-with-bitwise-and-greater-than-zero
2503-longest-subarray-with-maximum-bitwise-and
3291-find-if-array-can-be-sorted
3380-shortest-subarray-with-or-at-least-k-ii
3394-minimum-array-end

Enumeration

2170-count-number-of-maximum-bitwise-or-subsets

Brainteaser

2503-longest-subarray-with-maximum-bitwise-and

Tree

0102-binary-tree-level-order-traversal
0896-smallest-subtree-with-all-the-deepest-nodes
0988-flip-equivalent-binary-trees
1035-cousins-in-binary-tree
1116-maximum-level-sum-of-a-binary-tree
1218-lowest-common-ancestor-of-deepest-leaves
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Breadth-First Search

0102-binary-tree-level-order-traversal
0896-smallest-subtree-with-all-the-deepest-nodes
1035-cousins-in-binary-tree
1116-maximum-level-sum-of-a-binary-tree
1218-lowest-common-ancestor-of-deepest-leaves
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Binary Tree

0102-binary-tree-level-order-traversal
0896-smallest-subtree-with-all-the-deepest-nodes
0988-flip-equivalent-binary-trees
1035-cousins-in-binary-tree
1116-maximum-level-sum-of-a-binary-tree
1218-lowest-common-ancestor-of-deepest-leaves
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Dynamic Programming

0097-interleaving-string
0118-pascals-triangle
0300-longest-increasing-subsequence
1402-count-square-submatrices-with-all-ones
1766-minimum-number-of-removals-to-make-mountain-array
2164-two-best-non-overlapping-events
2554-minimum-total-distance-traveled
2586-longest-square-streak-in-an-array
2794-maximum-number-of-moves-in-a-grid

Matrix

0073-set-matrix-zeroes
1402-count-square-submatrices-with-all-ones
2794-maximum-number-of-moves-in-a-grid
3188-find-champion-i

String Matching

0812-rotate-string
1524-string-matching-in-an-array
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
2292-counting-words-with-a-given-prefix
3309-count-prefix-and-suffix-pairs-i

Number Theory

2716-prime-subtraction-operation

Rolling Hash

3309-count-prefix-and-suffix-pairs-i

Hash Function

3309-count-prefix-and-suffix-pairs-i

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published