Skip to content

Collection of LeetCode questions to ace the coding interview! - Created using [LeetHub](https://github.com/QasimWani/LeetHub)

Notifications You must be signed in to change notification settings

GauravB09/LeetCode-Submissions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode-Submissions

Collection of LeetCode questions to ace the coding interview! - Created using LeetHub

Array

0001-two-sum
0011-container-with-most-water
0015-3sum
0026-remove-duplicates-from-sorted-array
0027-remove-element
0036-valid-sudoku
0045-jump-game-ii
0049-group-anagrams
0054-spiral-matrix
0055-jump-game
0056-merge-intervals
0057-insert-interval
0066-plus-one
0075-sort-colors
0080-remove-duplicates-from-sorted-array-ii
0088-merge-sorted-array
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0128-longest-consecutive-sequence
0134-gas-station
0135-candy
0150-evaluate-reverse-polish-notation
0167-two-sum-ii-input-array-is-sorted
0169-majority-element
0189-rotate-array
0209-minimum-size-subarray-sum
0219-contains-duplicate-ii
0228-summary-ranges
0238-product-of-array-except-self
0274-h-index
0330-patching-array
0380-insert-delete-getrandom-o1
0502-ipo
0523-continuous-subarray-sum
0648-replace-words
0853-most-profit-assigning-work
0876-hand-of-straights
0982-minimum-increment-to-make-array-unique
1016-subarray-sums-divisible-by-k
1037-minimum-number-of-k-consecutive-bit-flips
1044-find-common-characters
1137-height-checker
1138-grumpy-bookstore-owner
1217-relative-sort-array
1370-count-number-of-nice-subarrays
1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit
1605-minimum-number-of-days-to-make-m-bouquets
1675-magnetic-force-between-two-balls
2148-minimum-number-of-moves-to-seat-everyone

Two Pointers

0011-container-with-most-water
0015-3sum
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
0061-rotate-list
0075-sort-colors
0080-remove-duplicates-from-sorted-array-ii
0082-remove-duplicates-from-sorted-list-ii
0086-partition-list
0088-merge-sorted-array
0125-valid-palindrome
0141-linked-list-cycle
0151-reverse-words-in-a-string
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0202-happy-number
0392-is-subsequence
0633-sum-of-square-numbers
0853-most-profit-assigning-work
2572-append-characters-to-string-to-make-subsequence

Sorting

0015-3sum
0049-group-anagrams
0056-merge-intervals
0075-sort-colors
0088-merge-sorted-array
0169-majority-element
0242-valid-anagram
0274-h-index
0502-ipo
0853-most-profit-assigning-work
0876-hand-of-straights
0982-minimum-increment-to-make-array-unique
1137-height-checker
1217-relative-sort-array
1675-magnetic-force-between-two-balls
2148-minimum-number-of-moves-to-seat-everyone
2379-maximum-total-importance-of-roads

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0013-roman-to-integer
0030-substring-with-concatenation-of-all-words
0036-valid-sudoku
0049-group-anagrams
0076-minimum-window-substring
0128-longest-consecutive-sequence
0138-copy-list-with-random-pointer
0141-linked-list-cycle
0169-majority-element
0202-happy-number
0205-isomorphic-strings
0219-contains-duplicate-ii
0242-valid-anagram
0290-word-pattern
0380-insert-delete-getrandom-o1
0383-ransom-note
0409-longest-palindrome
0523-continuous-subarray-sum
0648-replace-words
0876-hand-of-straights
1016-subarray-sums-divisible-by-k
1044-find-common-characters
1217-relative-sort-array
1370-count-number-of-nice-subarrays

Divide and Conquer

0169-majority-element
1285-balance-a-binary-search-tree

Counting

0169-majority-element

Math

0002-add-two-numbers
0009-palindrome-number
0013-roman-to-integer
0066-plus-one
0150-evaluate-reverse-polish-notation
0189-rotate-array
0202-happy-number
0380-insert-delete-getrandom-o1
0523-continuous-subarray-sum
0633-sum-of-square-numbers
1370-count-number-of-nice-subarrays

Dynamic Programming

0045-jump-game-ii
0055-jump-game
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0392-is-subsequence

Greedy

0011-container-with-most-water
0045-jump-game-ii
0055-jump-game
0122-best-time-to-buy-and-sell-stock-ii
0134-gas-station
0135-candy
0330-patching-array
0409-longest-palindrome
0502-ipo
0853-most-profit-assigning-work
0876-hand-of-straights
0982-minimum-increment-to-make-array-unique
1285-balance-a-binary-search-tree
2148-minimum-number-of-moves-to-seat-everyone
2379-maximum-total-importance-of-roads
2572-append-characters-to-string-to-make-subsequence

Counting Sort

0274-h-index
0383-ransom-note
0982-minimum-increment-to-make-array-unique
1137-height-checker
1217-relative-sort-array

Design

0380-insert-delete-getrandom-o1

Randomized

0380-insert-delete-getrandom-o1

Prefix Sum

0209-minimum-size-subarray-sum
0238-product-of-array-except-self
0523-continuous-subarray-sum
1016-subarray-sums-divisible-by-k
1037-minimum-number-of-k-consecutive-bit-flips

String

0006-zigzag-conversion
0013-roman-to-integer
0014-longest-common-prefix
0028-find-the-index-of-the-first-occurrence-in-a-string
0058-length-of-last-word
0151-reverse-words-in-a-string

Trie

0014-longest-common-prefix
0648-replace-words

String Matching

0003-longest-substring-without-repeating-characters
0020-valid-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0030-substring-with-concatenation-of-all-words
0049-group-anagrams
0071-simplify-path
0076-minimum-window-substring
0125-valid-palindrome
0151-reverse-words-in-a-string
0205-isomorphic-strings
0242-valid-anagram
0290-word-pattern
0383-ransom-note
0392-is-subsequence
0409-longest-palindrome
0648-replace-words
1044-find-common-characters
2572-append-characters-to-string-to-make-subsequence
3379-score-of-a-string

Binary Search

0167-two-sum-ii-input-array-is-sorted
0209-minimum-size-subarray-sum
0633-sum-of-square-numbers
0853-most-profit-assigning-work
1605-minimum-number-of-days-to-make-m-bouquets
1675-magnetic-force-between-two-balls

Sliding Window

0003-longest-substring-without-repeating-characters
0030-substring-with-concatenation-of-all-words
0076-minimum-window-substring
0209-minimum-size-subarray-sum
0219-contains-duplicate-ii
1037-minimum-number-of-k-consecutive-bit-flips
1138-grumpy-bookstore-owner
1370-count-number-of-nice-subarrays
1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit

Stack

0020-valid-parentheses
0071-simplify-path
0150-evaluate-reverse-polish-notation

Matrix

0036-valid-sudoku
0054-spiral-matrix

Simulation

0054-spiral-matrix

Union Find

0128-longest-consecutive-sequence

Tree

0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0112-path-sum
0226-invert-binary-tree
1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Depth-First Search

0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0112-path-sum
0226-invert-binary-tree
1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0112-path-sum
0226-invert-binary-tree

Binary Tree

0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0112-path-sum
0226-invert-binary-tree
1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Linked List

0002-add-two-numbers
0019-remove-nth-node-from-end-of-list
0021-merge-two-sorted-lists
0061-rotate-list
0082-remove-duplicates-from-sorted-list-ii
0086-partition-list
0092-reverse-linked-list-ii
0138-copy-list-with-random-pointer
0141-linked-list-cycle

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists

Heap (Priority Queue)

0502-ipo
1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit
2379-maximum-total-importance-of-roads

Queue

1037-minimum-number-of-k-consecutive-bit-flips
1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit

Ordered Set

1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit

Monotonic Queue

1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit

Bit Manipulation

1037-minimum-number-of-k-consecutive-bit-flips

Binary Search Tree

1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Graph

1916-find-center-of-star-graph
2379-maximum-total-importance-of-roads

LeetCode Topics

Array

0048-rotate-image
0073-set-matrix-zeroes
0289-game-of-life
0350-intersection-of-two-arrays-ii
0624-maximum-distance-in-arrays
0870-magic-squares-in-grid
0890-lemonade-change
0921-spiral-matrix-iii
0948-sort-an-array
1196-filling-bookcase-shelves
1207-delete-nodes-and-return-forest
1293-three-consecutive-odds
1333-sort-the-jumbled-numbers
1496-lucky-numbers-in-a-matrix
1511-count-number-of-teams
1556-make-two-arrays-equal-by-reversing-subarrays
1615-range-sum-of-sorted-subarray-sums
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1691-minimum-number-of-days-to-disconnect-island
1711-find-valid-matrix-given-row-and-column-sums
1720-crawler-log-folder
1741-sort-array-by-increasing-frequency
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2163-kth-distinct-string-in-an-array
2255-minimum-swaps-to-group-all-1s-together-ii
2306-create-binary-tree-from-descriptions
2472-build-a-matrix-with-conditions
2502-sort-the-people
2727-number-of-senior-citizens
2846-robot-collisions
3235-minimum-cost-to-convert-string-i

Hash Table

0073-set-matrix-zeroes
0127-word-ladder
0350-intersection-of-two-arrays-ii
0726-number-of-atoms
0870-magic-squares-in-grid
1207-delete-nodes-and-return-forest
1556-make-two-arrays-equal-by-reversing-subarrays
1741-sort-array-by-increasing-frequency
2163-kth-distinct-string-in-an-array
2186-count-vowel-substrings-of-a-string
2306-create-binary-tree-from-descriptions
2502-sort-the-people
3276-minimum-number-of-pushes-to-type-word-ii

Matrix

0048-rotate-image
0073-set-matrix-zeroes
0289-game-of-life
0870-magic-squares-in-grid
0921-spiral-matrix-iii
1496-lucky-numbers-in-a-matrix
1691-minimum-number-of-days-to-disconnect-island
1711-find-valid-matrix-given-row-and-column-sums
2472-build-a-matrix-with-conditions

Math

0048-rotate-image
0069-sqrtx
0172-factorial-trailing-zeroes
0273-integer-to-english-words
0870-magic-squares-in-grid
1642-water-bottles
1951-find-the-winner-of-the-circular-game
2645-pass-the-pillow

Depth-First Search

0098-validate-binary-search-tree
0129-sum-root-to-leaf-numbers
1207-delete-nodes-and-return-forest
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1653-number-of-good-leaf-nodes-pairs
1691-minimum-number-of-days-to-disconnect-island
2217-step-by-step-directions-from-a-binary-tree-node-to-another

Breadth-First Search

0127-word-ladder
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1691-minimum-number-of-days-to-disconnect-island

Graph

1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1701-remove-max-number-of-edges-to-keep-graph-fully-traversable
2472-build-a-matrix-with-conditions
3235-minimum-cost-to-convert-string-i

Topological Sort

1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
2472-build-a-matrix-with-conditions

Union Find

1701-remove-max-number-of-edges-to-keep-graph-fully-traversable

Simulation

0289-game-of-life
0921-spiral-matrix-iii
1642-water-bottles
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2299-merge-nodes-in-between-zeros
2645-pass-the-pillow
2846-robot-collisions

Two Pointers

0350-intersection-of-two-arrays-ii
1615-range-sum-of-sorted-subarray-sums

Binary Search

0069-sqrtx
0350-intersection-of-two-arrays-ii
1615-range-sum-of-sorted-subarray-sums

Sorting

0350-intersection-of-two-arrays-ii
0726-number-of-atoms
0948-sort-an-array
1333-sort-the-jumbled-numbers
1556-make-two-arrays-equal-by-reversing-subarrays
1615-range-sum-of-sorted-subarray-sums
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1741-sort-array-by-increasing-frequency
2502-sort-the-people
2846-robot-collisions
3276-minimum-number-of-pushes-to-type-word-ii

Greedy

0624-maximum-distance-in-arrays
0890-lemonade-change
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1711-find-valid-matrix-given-row-and-column-sums
1818-maximum-score-from-removing-substrings
3276-minimum-number-of-pushes-to-type-word-ii

Linked List

2182-find-the-minimum-and-maximum-number-of-nodes-between-critical-points
2299-merge-nodes-in-between-zeros

Tree

0098-validate-binary-search-tree
0129-sum-root-to-leaf-numbers
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
1653-number-of-good-leaf-nodes-pairs
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2306-create-binary-tree-from-descriptions

Binary Tree

0098-validate-binary-search-tree
0129-sum-root-to-leaf-numbers
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
1653-number-of-good-leaf-nodes-pairs
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2306-create-binary-tree-from-descriptions

Recursion

0273-integer-to-english-words
1951-find-the-winner-of-the-circular-game

Queue

1951-find-the-winner-of-the-circular-game

String

0127-word-ladder
0273-integer-to-english-words
0726-number-of-atoms
1298-reverse-substrings-between-each-pair-of-parentheses
1720-crawler-log-folder
1756-minimum-deletions-to-make-string-balanced
1818-maximum-score-from-removing-substrings
2163-kth-distinct-string-in-an-array
2186-count-vowel-substrings-of-a-string
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2502-sort-the-people
2727-number-of-senior-citizens
3235-minimum-cost-to-convert-string-i
3276-minimum-number-of-pushes-to-type-word-ii

Stack

0155-min-stack
0726-number-of-atoms
1298-reverse-substrings-between-each-pair-of-parentheses
1720-crawler-log-folder
1756-minimum-deletions-to-make-string-balanced
1818-maximum-score-from-removing-substrings
2846-robot-collisions

Divide and Conquer

0948-sort-an-array

Heap (Priority Queue)

0789-kth-largest-element-in-a-stream
0948-sort-an-array

Merge Sort

0948-sort-an-array

Bucket Sort

0948-sort-an-array

Radix Sort

0948-sort-an-array

Counting Sort

0948-sort-an-array
2163-kth-distinct-string-in-an-array
3276-minimum-number-of-pushes-to-type-word-ii

Dynamic Programming

1196-filling-bookcase-shelves
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1511-count-number-of-teams
1756-minimum-deletions-to-make-string-balanced

Shortest Path

1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
3235-minimum-cost-to-convert-string-i

Binary Indexed Tree

1511-count-number-of-teams

Sliding Window

2255-minimum-swaps-to-group-all-1s-together-ii

Strongly Connected Component

1691-minimum-number-of-days-to-disconnect-island

Design

0155-min-stack
0789-kth-largest-element-in-a-stream

Binary Search Tree

0098-validate-binary-search-tree
0789-kth-largest-element-in-a-stream

Data Stream

0789-kth-largest-element-in-a-stream

About

Collection of LeetCode questions to ace the coding interview! - Created using [LeetHub](https://github.com/QasimWani/LeetHub)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published