Skip to content

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

Notifications You must be signed in to change notification settings

Khushboo-25/DSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSA

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

LeetCode Topics

Two Pointers

0005-longest-palindromic-substring
0031-next-permutation
0042-trapping-rain-water
0567-permutation-in-string
0875-longest-mountain-in-array
2095-minimum-number-of-swaps-to-make-the-string-balanced
2128-reverse-prefix-of-word
2581-divide-players-into-teams-of-equal-skill

String

0005-longest-palindromic-substring
0010-regular-expression-matching
0022-generate-parentheses
0032-longest-valid-parentheses
0043-multiply-strings
0044-wildcard-matching
0072-edit-distance
0087-scramble-string
0091-decode-ways
0097-interleaving-string
0127-word-ladder
0139-word-break
0140-word-break-ii
0399-evaluate-division
0438-find-all-anagrams-in-a-string
0567-permutation-in-string
0712-minimum-ascii-delete-sum-for-two-strings
0763-special-binary-string
0878-shifting-letters
1371-minimum-remove-to-make-valid-parentheses
2095-minimum-number-of-swaps-to-make-the-string-balanced
2128-reverse-prefix-of-word
2157-smallest-k-length-subsequence-with-occurrences-of-a-letter
2532-remove-letter-to-equalize-frequency
3235-minimum-cost-to-convert-string-i
3395-minimum-length-of-anagram-concatenation

Dynamic Programming

0005-longest-palindromic-substring
0010-regular-expression-matching
0022-generate-parentheses
0032-longest-valid-parentheses
0042-trapping-rain-water
0044-wildcard-matching
0063-unique-paths-ii
0072-edit-distance
0085-maximal-rectangle
0087-scramble-string
0091-decode-ways
0097-interleaving-string
0123-best-time-to-buy-and-sell-stock-iii
0139-word-break
0140-word-break-ii
0188-best-time-to-buy-and-sell-stock-iv
0198-house-robber
0213-house-robber-ii
0221-maximal-square
0264-ugly-number-ii
0279-perfect-squares
0300-longest-increasing-subsequence
0309-best-time-to-buy-and-sell-stock-with-cooldown
0312-burst-balloons
0313-super-ugly-number
0322-coin-change
0329-longest-increasing-path-in-a-matrix
0337-house-robber-iii
0343-integer-break
0357-count-numbers-with-unique-digits
0376-wiggle-subsequence
0377-combination-sum-iv
0396-rotate-function
0397-integer-replacement
0403-frog-jump
0413-arithmetic-slices
0518-coin-change-ii
0712-minimum-ascii-delete-sum-for-two-strings
0714-best-time-to-buy-and-sell-stock-with-transaction-fee
0803-cheapest-flights-within-k-stops
0875-longest-mountain-in-array
0943-sum-of-subarray-minimums
1330-longest-arithmetic-subsequence-of-given-difference
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1766-minimum-number-of-removals-to-make-mountain-array
2090-number-of-ways-to-arrive-at-destination
2905-count-paths-that-can-form-a-palindrome-in-a-tree
3106-length-of-the-longest-subsequence-that-sums-to-target

Backtracking

0022-generate-parentheses
0140-word-break-ii
0357-count-numbers-with-unique-digits

Stack

0032-longest-valid-parentheses
0042-trapping-rain-water
0085-maximal-rectangle
0496-next-greater-element-i
0735-asteroid-collision
0933-increasing-order-search-tree
0943-sum-of-subarray-minimums
1371-minimum-remove-to-make-valid-parentheses
2095-minimum-number-of-swaps-to-make-the-string-balanced
2128-reverse-prefix-of-word
2157-smallest-k-length-subsequence-with-occurrences-of-a-letter
3114-beautiful-towers-i

Array

0031-next-permutation
0042-trapping-rain-water
0057-insert-interval
0063-unique-paths-ii
0085-maximal-rectangle
0108-convert-sorted-array-to-binary-search-tree
0123-best-time-to-buy-and-sell-stock-iii
0135-candy
0139-word-break
0140-word-break-ii
0149-max-points-on-a-line
0188-best-time-to-buy-and-sell-stock-iv
0198-house-robber
0200-number-of-islands
0213-house-robber-ii
0220-contains-duplicate-iii
0221-maximal-square
0300-longest-increasing-subsequence
0309-best-time-to-buy-and-sell-stock-with-cooldown
0312-burst-balloons
0313-super-ugly-number
0322-coin-change
0329-longest-increasing-path-in-a-matrix
0376-wiggle-subsequence
0377-combination-sum-iv
0396-rotate-function
0399-evaluate-division
0403-frog-jump
0413-arithmetic-slices
0463-island-perimeter
0496-next-greater-element-i
0502-ipo
0518-coin-change-ii
0523-continuous-subarray-sum
0525-contiguous-array
0713-subarray-product-less-than-k
0714-best-time-to-buy-and-sell-stock-with-transaction-fee
0735-asteroid-collision
0794-swim-in-rising-water
0854-making-a-large-island
0875-longest-mountain-in-array
0878-shifting-letters
0892-shortest-subarray-with-sum-at-least-k
0940-fruit-into-baskets
0943-sum-of-subarray-minimums
0950-x-of-a-kind-in-a-deck-of-cards
1016-subarray-sums-divisible-by-k
1171-shortest-path-in-binary-matrix
1325-path-with-maximum-probability
1330-longest-arithmetic-subsequence-of-given-difference
1435-xor-queries-of-a-subarray
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1766-minimum-number-of-removals-to-make-mountain-array
1966-frequency-of-the-most-frequent-element
2375-minimum-obstacle-removal-to-reach-corner
2581-divide-players-into-teams-of-equal-skill
2711-minimum-time-to-visit-a-cell-in-a-grid
3106-length-of-the-longest-subsequence-that-sums-to-target
3114-beautiful-towers-i
3196-apply-operations-to-maximize-frequency-score
3235-minimum-cost-to-convert-string-i
3389-minimum-time-to-visit-disappearing-nodes
3522-find-the-power-of-k-size-subarrays-i
3558-find-a-safe-walk-through-a-grid

Matrix

0063-unique-paths-ii
0085-maximal-rectangle
0200-number-of-islands
0221-maximal-square
0329-longest-increasing-path-in-a-matrix
0463-island-perimeter
0794-swim-in-rising-water
0854-making-a-large-island
1171-shortest-path-in-binary-matrix
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
3558-find-a-safe-walk-through-a-grid

Database

0175-combine-two-tables
0176-second-highest-salary
0177-nth-highest-salary
0178-rank-scores
0181-employees-earning-more-than-their-managers
0584-find-customer-referee
0595-big-countries
1908-recyclable-and-low-fat-products

Binary Search

0300-longest-increasing-subsequence
0713-subarray-product-less-than-k
0794-swim-in-rising-water
0892-shortest-subarray-with-sum-at-least-k
1307-ugly-number-iii
1766-minimum-number-of-removals-to-make-mountain-array
1966-frequency-of-the-most-frequent-element
3196-apply-operations-to-maximize-frequency-score

Greedy

0044-wildcard-matching
0135-candy
0376-wiggle-subsequence
0397-integer-replacement
0502-ipo
0714-best-time-to-buy-and-sell-stock-with-transaction-fee
1766-minimum-number-of-removals-to-make-mountain-array
1966-frequency-of-the-most-frequent-element
2095-minimum-number-of-swaps-to-make-the-string-balanced
2157-smallest-k-length-subsequence-with-occurrences-of-a-letter

Sliding Window

0220-contains-duplicate-iii
0413-arithmetic-slices
0438-find-all-anagrams-in-a-string
0567-permutation-in-string
0713-subarray-product-less-than-k
0892-shortest-subarray-with-sum-at-least-k
0940-fruit-into-baskets
1966-frequency-of-the-most-frequent-element
3196-apply-operations-to-maximize-frequency-score
3522-find-the-power-of-k-size-subarrays-i

Sorting

0220-contains-duplicate-iii
0502-ipo
1966-frequency-of-the-most-frequent-element
2581-divide-players-into-teams-of-equal-skill
3196-apply-operations-to-maximize-frequency-score

Prefix Sum

0523-continuous-subarray-sum
0525-contiguous-array
0713-subarray-product-less-than-k
0878-shifting-letters
0892-shortest-subarray-with-sum-at-least-k
1016-subarray-sums-divisible-by-k
1435-xor-queries-of-a-subarray
1966-frequency-of-the-most-frequent-element
3196-apply-operations-to-maximize-frequency-score

Depth-First Search

0117-populating-next-right-pointers-in-each-node-ii
0129-sum-root-to-leaf-numbers
0200-number-of-islands
0329-longest-increasing-path-in-a-matrix
0337-house-robber-iii
0399-evaluate-division
0463-island-perimeter
0538-convert-bst-to-greater-tree
0687-longest-univalue-path
0744-network-delay-time
0794-swim-in-rising-water
0801-is-graph-bipartite
0803-cheapest-flights-within-k-stops
0854-making-a-large-island
0922-possible-bipartition
0933-increasing-order-search-tree
1300-critical-connections-in-a-network
1442-number-of-operations-to-make-network-connected
1576-reorder-routes-to-make-all-paths-lead-to-the-city-zero
2905-count-paths-that-can-form-a-palindrome-in-a-tree
3386-find-edges-in-shortest-paths

Breadth-First Search

0117-populating-next-right-pointers-in-each-node-ii
0127-word-ladder
0200-number-of-islands
0279-perfect-squares
0322-coin-change
0329-longest-increasing-path-in-a-matrix
0399-evaluate-division
0463-island-perimeter
0744-network-delay-time
0794-swim-in-rising-water
0801-is-graph-bipartite
0803-cheapest-flights-within-k-stops
0854-making-a-large-island
0922-possible-bipartition
1171-shortest-path-in-binary-matrix
1442-number-of-operations-to-make-network-connected
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1576-reorder-routes-to-make-all-paths-lead-to-the-city-zero
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
3386-find-edges-in-shortest-paths
3558-find-a-safe-walk-through-a-grid

Graph

0329-longest-increasing-path-in-a-matrix
0399-evaluate-division
0744-network-delay-time
0801-is-graph-bipartite
0803-cheapest-flights-within-k-stops
0922-possible-bipartition
1300-critical-connections-in-a-network
1325-path-with-maximum-probability
1442-number-of-operations-to-make-network-connected
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1576-reorder-routes-to-make-all-paths-lead-to-the-city-zero
1887-minimum-degree-of-a-connected-trio-in-a-graph
2090-number-of-ways-to-arrive-at-destination
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
3235-minimum-cost-to-convert-string-i
3386-find-edges-in-shortest-paths
3389-minimum-time-to-visit-disappearing-nodes
3558-find-a-safe-walk-through-a-grid

Heap (Priority Queue)

0264-ugly-number-ii
0502-ipo
0744-network-delay-time
0794-swim-in-rising-water
0803-cheapest-flights-within-k-stops
0892-shortest-subarray-with-sum-at-least-k
1325-path-with-maximum-probability
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
3386-find-edges-in-shortest-paths
3389-minimum-time-to-visit-disappearing-nodes
3558-find-a-safe-walk-through-a-grid

Shortest Path

0399-evaluate-division
0744-network-delay-time
0803-cheapest-flights-within-k-stops
1325-path-with-maximum-probability
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2090-number-of-ways-to-arrive-at-destination
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
3235-minimum-cost-to-convert-string-i
3386-find-edges-in-shortest-paths
3389-minimum-time-to-visit-disappearing-nodes
3558-find-a-safe-walk-through-a-grid

Topological Sort

0329-longest-increasing-path-in-a-matrix
2090-number-of-ways-to-arrive-at-destination

Math

0043-multiply-strings
0149-max-points-on-a-line
0264-ugly-number-ii
0279-perfect-squares
0313-super-ugly-number
0343-integer-break
0357-count-numbers-with-unique-digits
0396-rotate-function
0523-continuous-subarray-sum
0795-k-th-symbol-in-grammar
0950-x-of-a-kind-in-a-deck-of-cards
1307-ugly-number-iii

Bit Manipulation

0397-integer-replacement
0795-k-th-symbol-in-grammar
1435-xor-queries-of-a-subarray
2905-count-paths-that-can-form-a-palindrome-in-a-tree

Recursion

0010-regular-expression-matching
0044-wildcard-matching
0763-special-binary-string
0795-k-th-symbol-in-grammar

Union Find

0200-number-of-islands
0399-evaluate-division
0794-swim-in-rising-water
0801-is-graph-bipartite
0854-making-a-large-island
0922-possible-bipartition
1442-number-of-operations-to-make-network-connected

Hash Table

0127-word-ladder
0139-word-break
0140-word-break-ii
0146-lru-cache
0149-max-points-on-a-line
0264-ugly-number-ii
0438-find-all-anagrams-in-a-string
0496-next-greater-element-i
0523-continuous-subarray-sum
0525-contiguous-array
0567-permutation-in-string
0940-fruit-into-baskets
0950-x-of-a-kind-in-a-deck-of-cards
1016-subarray-sums-divisible-by-k
1330-longest-arithmetic-subsequence-of-given-difference
2532-remove-letter-to-equalize-frequency
2581-divide-players-into-teams-of-equal-skill
3395-minimum-length-of-anagram-concatenation

Tree

0108-convert-sorted-array-to-binary-search-tree
0109-convert-sorted-list-to-binary-search-tree
0117-populating-next-right-pointers-in-each-node-ii
0129-sum-root-to-leaf-numbers
0337-house-robber-iii
0538-convert-bst-to-greater-tree
0687-longest-univalue-path
0933-increasing-order-search-tree
2905-count-paths-that-can-form-a-palindrome-in-a-tree

Binary Tree

0108-convert-sorted-array-to-binary-search-tree
0109-convert-sorted-list-to-binary-search-tree
0117-populating-next-right-pointers-in-each-node-ii
0129-sum-root-to-leaf-numbers
0337-house-robber-iii
0538-convert-bst-to-greater-tree
0687-longest-univalue-path
0933-increasing-order-search-tree

Linked List

0109-convert-sorted-list-to-binary-search-tree
0117-populating-next-right-pointers-in-each-node-ii
0146-lru-cache

Design

0146-lru-cache

Doubly-Linked List

0146-lru-cache

Simulation

0043-multiply-strings
0735-asteroid-collision

Monotonic Stack

0042-trapping-rain-water
0085-maximal-rectangle
0496-next-greater-element-i
0943-sum-of-subarray-minimums
2157-smallest-k-length-subsequence-with-occurrences-of-a-letter
3114-beautiful-towers-i

Biconnected Component

1300-critical-connections-in-a-network

Counting

0950-x-of-a-kind-in-a-deck-of-cards
2532-remove-letter-to-equalize-frequency
3395-minimum-length-of-anagram-concatenation

Number Theory

0950-x-of-a-kind-in-a-deck-of-cards
1307-ugly-number-iii

Memoization

0139-word-break
0140-word-break-ii
0329-longest-increasing-path-in-a-matrix
0397-integer-replacement

Trie

0139-word-break
0140-word-break-ii

Combinatorics

1307-ugly-number-iii

Enumeration

0875-longest-mountain-in-array

Bitmask

2905-count-paths-that-can-form-a-palindrome-in-a-tree

Geometry

0149-max-points-on-a-line

Bucket Sort

0220-contains-duplicate-iii

Ordered Set

0220-contains-duplicate-iii

Queue

0892-shortest-subarray-with-sum-at-least-k

Monotonic Queue

0892-shortest-subarray-with-sum-at-least-k

Divide and Conquer

0108-convert-sorted-array-to-binary-search-tree
0109-convert-sorted-list-to-binary-search-tree

Binary Search Tree

0108-convert-sorted-array-to-binary-search-tree
0109-convert-sorted-list-to-binary-search-tree
0538-convert-bst-to-greater-tree
0933-increasing-order-search-tree

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages