Skip to content

Welcome to LeetCode Quest! 🎯 This is your go-to treasure trove πŸ’Ž for coding interview questions, challenges, and solutions. From beginner to expert πŸšΆβ€β™‚οΈβž‘οΈπŸƒβ€β™€οΈ, we've got problems for every skill level.

Notifications You must be signed in to change notification settings

PriyobrotoKarmakar/LeetCode-Ans

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

Hash Table

0049-group-anagrams
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0432-all-oone-data-structure
0567-permutation-in-string
0632-smallest-range-covering-elements-from-k-lists
0920-uncommon-words-from-two-sentences
1147-flip-columns-for-maximum-number-of-equal-rows
1256-rank-transform-of-an-array
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
2054-the-number-of-the-smallest-unoccupied-chair
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
2755-extra-characters-in-a-string
3267-find-longest-special-substring-that-occurs-thrice-i
3329-find-the-length-of-the-longest-common-prefix

String

0049-group-anagrams
0179-largest-number
0214-shortest-palindrome
0241-different-ways-to-add-parentheses
0412-fizz-buzz
0539-minimum-time-difference
0567-permutation-in-string
0812-rotate-string
0920-uncommon-words-from-two-sentences
0957-minimum-add-to-make-parentheses-valid
1197-parsing-a-boolean-expression
1302-delete-characters-to-make-fancy-string
1304-longest-happy-string
1350-remove-sub-folders-from-the-filesystem
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
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
2494-sum-of-prefix-scores-of-strings
2580-circular-sentence
2599-take-k-of-each-character-from-left-and-right
2755-extra-characters-in-a-string
2800-minimum-string-length-after-removing-substrings
3018-make-string-a-subsequence-using-cyclic-increments
3174-minimum-number-of-changes-to-make-binary-string-beautiful
3195-separate-black-and-white-balls
3267-find-longest-special-substring-that-occurs-thrice-i
3329-find-the-length-of-the-longest-common-prefix
3451-string-compression-iii

Counting

0920-uncommon-words-from-two-sentences
1620-check-if-array-pairs-are-divisible-by-k
2494-sum-of-prefix-scores-of-strings
3267-find-longest-special-substring-that-occurs-thrice-i

Array

0049-group-anagrams
0053-maximum-subarray
0088-merge-sorted-array
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0118-pascals-triangle
0179-largest-number
0198-house-robber
0200-number-of-islands
0209-minimum-size-subarray-sum
0215-kth-largest-element-in-an-array
0300-longest-increasing-subsequence
0322-coin-change
0539-minimum-time-difference
0632-smallest-range-covering-elements-from-k-lists
0729-my-calendar-i
0731-my-calendar-ii
0787-sliding-puzzle
0853-most-profit-assigning-work
0859-design-circular-deque
0892-shortest-subarray-with-sum-at-least-k
1002-maximum-width-ramp
1147-flip-columns-for-maximum-number-of-equal-rows
1256-rank-transform-of-an-array
1325-path-with-maximum-probability
1350-remove-sub-folders-from-the-filesystem
1402-count-square-submatrices-with-all-ones
1468-check-if-n-and-its-double-exist
1497-design-a-stack-with-increment-operation
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
1755-defuse-the-bomb
1766-minimum-number-of-removals-to-make-mountain-array
1886-minimum-limit-of-balls-in-a-bag
1917-maximum-average-pass-ratio
1923-sentence-similarity-iii
1940-maximum-xor-for-each-query
1972-rotating-the-box
2054-the-number-of-the-smallest-unoccupied-chair
2089-maximum-matrix-sum
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
2232-adding-spaces-to-a-string
2343-count-unguarded-cells-in-the-grid
2375-minimum-obstacle-removal-to-reach-corner
2488-divide-intervals-into-minimum-number-of-groups
2494-sum-of-prefix-scores-of-strings
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
2692-take-gifts-from-the-richest-pile
2699-count-the-number-of-fair-pairs
2711-minimum-time-to-visit-a-cell-in-a-grid
2716-prime-subtraction-operation
2755-extra-characters-in-a-string
2794-maximum-number-of-moves-in-a-grid
2868-continuous-subarrays
3291-find-if-array-can-be-sorted
3329-find-the-length-of-the-longest-common-prefix
3380-shortest-subarray-with-or-at-least-k-ii
3427-special-array-ii
3517-shortest-distance-after-road-addition-queries-i
3522-find-the-power-of-k-size-subarrays-i

Math

0241-different-ways-to-add-parentheses
0412-fizz-buzz
0539-minimum-time-difference
0670-maximum-swap
1013-fibonacci-number
1444-number-of-steps-to-reduce-a-number-to-zero
2716-prime-subtraction-operation

Sorting

0049-group-anagrams
0088-merge-sorted-array
0179-largest-number
0215-kth-largest-element-in-an-array
0539-minimum-time-difference
0632-smallest-range-covering-elements-from-k-lists
0853-most-profit-assigning-work
1256-rank-transform-of-an-array
1468-check-if-n-and-its-double-exist
2164-two-best-non-overlapping-events
2179-most-beautiful-item-for-each-query
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
3291-find-if-array-can-be-sorted

Greedy

0179-largest-number
0632-smallest-range-covering-elements-from-k-lists
0670-maximum-swap
0853-most-profit-assigning-work
0957-minimum-add-to-make-parentheses-valid
1304-longest-happy-string
1766-minimum-number-of-removals-to-make-mountain-array
1917-maximum-average-pass-ratio
2089-maximum-matrix-sum
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

Dynamic Programming

0053-maximum-subarray
0118-pascals-triangle
0198-house-robber
0241-different-ways-to-add-parentheses
0300-longest-increasing-subsequence
0322-coin-change
1013-fibonacci-number
1402-count-square-submatrices-with-all-ones
1475-maximum-sum-bst-in-binary-tree
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
2755-extra-characters-in-a-string
2794-maximum-number-of-moves-in-a-grid

Divide and Conquer

0053-maximum-subarray
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0215-kth-largest-element-in-an-array

Recursion

0241-different-ways-to-add-parentheses
1013-fibonacci-number
1197-parsing-a-boolean-expression
1667-find-kth-bit-in-nth-binary-string

Memoization

0241-different-ways-to-add-parentheses
1013-fibonacci-number

Rolling Hash

0214-shortest-palindrome

String Matching

0214-shortest-palindrome
0812-rotate-string
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence

Hash Function

0214-shortest-palindrome

Depth-First Search

0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0200-number-of-islands
0386-lexicographical-numbers
0988-flip-equivalent-binary-trees
1350-remove-sub-folders-from-the-filesystem
1475-maximum-sum-bst-in-binary-tree
2201-valid-arrangement-of-pairs
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
2494-sum-of-prefix-scores-of-strings
2755-extra-characters-in-a-string
3329-find-the-length-of-the-longest-common-prefix

Tree

0094-binary-tree-inorder-traversal
0102-binary-tree-level-order-traversal
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0450-delete-node-in-a-bst
0988-flip-equivalent-binary-trees
0998-check-completeness-of-a-binary-tree
1475-maximum-sum-bst-in-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

0094-binary-tree-inorder-traversal
0102-binary-tree-level-order-traversal
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0450-delete-node-in-a-bst
0988-flip-equivalent-binary-trees
0998-check-completeness-of-a-binary-tree
1475-maximum-sum-bst-in-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 Search

0209-minimum-size-subarray-sum
0300-longest-increasing-subsequence
0729-my-calendar-i
0731-my-calendar-ii
0853-most-profit-assigning-work
0892-shortest-subarray-with-sum-at-least-k
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
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
2716-prime-subtraction-operation
3267-find-longest-special-substring-that-occurs-thrice-i
3427-special-array-ii

Design

0432-all-oone-data-structure
0729-my-calendar-i
0731-my-calendar-ii
0859-design-circular-deque
1497-design-a-stack-with-increment-operation

Segment Tree

0729-my-calendar-i
0731-my-calendar-ii

Ordered Set

0729-my-calendar-i
0731-my-calendar-ii
2868-continuous-subarrays

Prefix Sum

0209-minimum-size-subarray-sum
0731-my-calendar-ii
0892-shortest-subarray-with-sum-at-least-k
1694-make-sum-divisible-by-p
1940-maximum-xor-for-each-query
2488-divide-intervals-into-minimum-number-of-groups
3427-special-array-ii

Linked List

0432-all-oone-data-structure
0859-design-circular-deque

Queue

0859-design-circular-deque
0892-shortest-subarray-with-sum-at-least-k
2868-continuous-subarrays

Doubly-Linked List

0432-all-oone-data-structure

Stack

0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0957-minimum-add-to-make-parentheses-valid
1002-maximum-width-ramp
1197-parsing-a-boolean-expression
1497-design-a-stack-with-increment-operation
1679-shortest-subarray-to-be-removed-to-make-array-sorted
2095-minimum-number-of-swaps-to-make-the-string-balanced
2800-minimum-string-length-after-removing-substrings

Two Pointers

0088-merge-sorted-array
0567-permutation-in-string
0853-most-profit-assigning-work
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
1923-sentence-similarity-iii
1972-rotating-the-box
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
3018-make-string-a-subsequence-using-cyclic-increments
3195-separate-black-and-white-balls

Sliding Window

0209-minimum-size-subarray-sum
0567-permutation-in-string
0632-smallest-range-covering-elements-from-k-lists
0892-shortest-subarray-with-sum-at-least-k
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
3267-find-longest-special-substring-that-occurs-thrice-i
3380-shortest-subarray-with-or-at-least-k-ii
3522-find-the-power-of-k-size-subarrays-i

Simulation

0412-fizz-buzz
1667-find-kth-bit-in-nth-binary-string
2232-adding-spaces-to-a-string
2343-count-unguarded-cells-in-the-grid
2692-take-gifts-from-the-richest-pile
2800-minimum-string-length-after-removing-substrings

Monotonic Stack

1002-maximum-width-ramp
1679-shortest-subarray-to-be-removed-to-make-array-sorted

Heap (Priority Queue)

0215-kth-largest-element-in-an-array
0632-smallest-range-covering-elements-from-k-lists
0892-shortest-subarray-with-sum-at-least-k
1304-longest-happy-string
1325-path-with-maximum-probability
1917-maximum-average-pass-ratio
2054-the-number-of-the-smallest-unoccupied-chair
2164-two-best-non-overlapping-events
2375-minimum-obstacle-removal-to-reach-corner
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
2692-take-gifts-from-the-richest-pile
2711-minimum-time-to-visit-a-cell-in-a-grid
2868-continuous-subarrays

Backtracking

1715-split-a-string-into-the-max-number-of-unique-substrings
2170-count-number-of-maximum-bitwise-or-subsets

Bit Manipulation

1444-number-of-steps-to-reduce-a-number-to-zero
1940-maximum-xor-for-each-query
2170-count-number-of-maximum-bitwise-or-subsets
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

Breadth-First Search

0102-binary-tree-level-order-traversal
0200-number-of-islands
0322-coin-change
0787-sliding-puzzle
0998-check-completeness-of-a-binary-tree
2375-minimum-obstacle-removal-to-reach-corner
2545-height-of-binary-tree-after-subtree-removal-queries
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii
2711-minimum-time-to-visit-a-cell-in-a-grid
3517-shortest-distance-after-road-addition-queries-i

Binary Search Tree

0450-delete-node-in-a-bst
1475-maximum-sum-bst-in-binary-tree

Matrix

0200-number-of-islands
0787-sliding-puzzle
1147-flip-columns-for-maximum-number-of-equal-rows
1402-count-square-submatrices-with-all-ones
1972-rotating-the-box
2089-maximum-matrix-sum
2343-count-unguarded-cells-in-the-grid
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
2794-maximum-number-of-moves-in-a-grid

Quickselect

0215-kth-largest-element-in-an-array

Number Theory

2716-prime-subtraction-operation

Graph

1325-path-with-maximum-probability
2201-valid-arrangement-of-pairs
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
3189-find-champion-ii
3517-shortest-distance-after-road-addition-queries-i

Shortest Path

1325-path-with-maximum-probability
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid

Monotonic Queue

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

Union Find

0200-number-of-islands

Eulerian Circuit

2201-valid-arrangement-of-pairs

About

Welcome to LeetCode Quest! 🎯 This is your go-to treasure trove πŸ’Ž for coding interview questions, challenges, and solutions. From beginner to expert πŸšΆβ€β™‚οΈβž‘οΈπŸƒβ€β™€οΈ, we've got problems for every skill level.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published