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

shrutisinghania/LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode

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

LeetCode Topics

Tree

0098-validate-binary-search-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0124-binary-tree-maximum-path-sum
0145-binary-tree-postorder-traversal
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
0653-two-sum-iv-input-is-a-bst
0662-maximum-width-of-binary-tree
0776-n-ary-tree-postorder-traversal
0783-search-in-a-binary-search-tree
1116-maximum-level-sum-of-a-binary-tree
1484-linked-list-in-binary-tree
1493-frog-position-after-t-seconds

Depth-First Search

0098-validate-binary-search-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0124-binary-tree-maximum-path-sum
0133-clone-graph
0145-binary-tree-postorder-traversal
0200-number-of-islands
0207-course-schedule
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0329-longest-increasing-path-in-a-matrix
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
0653-two-sum-iv-input-is-a-bst
0662-maximum-width-of-binary-tree
0733-flood-fill
0776-n-ary-tree-postorder-traversal
0801-is-graph-bipartite
0813-all-paths-from-source-to-target
1116-maximum-level-sum-of-a-binary-tree
1484-linked-list-in-binary-tree
1493-frog-position-after-t-seconds
2035-count-sub-islands

Breadth-First Search

0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0116-populating-next-right-pointers-in-each-node
0133-clone-graph
0200-number-of-islands
0207-course-schedule
0329-longest-increasing-path-in-a-matrix
0653-two-sum-iv-input-is-a-bst
0662-maximum-width-of-binary-tree
0733-flood-fill
0801-is-graph-bipartite
0813-all-paths-from-source-to-target
1116-maximum-level-sum-of-a-binary-tree
1484-linked-list-in-binary-tree
1493-frog-position-after-t-seconds
2035-count-sub-islands

Binary Tree

0098-validate-binary-search-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0124-binary-tree-maximum-path-sum
0145-binary-tree-postorder-traversal
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
0653-two-sum-iv-input-is-a-bst
0662-maximum-width-of-binary-tree
0783-search-in-a-binary-search-tree
1116-maximum-level-sum-of-a-binary-tree
1484-linked-list-in-binary-tree

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0011-container-with-most-water
0026-remove-duplicates-from-sorted-array
0039-combination-sum
0040-combination-sum-ii
0041-first-missing-positive
0042-trapping-rain-water
0046-permutations
0048-rotate-image
0053-maximum-subarray
0056-merge-intervals
0064-minimum-path-sum
0073-set-matrix-zeroes
0074-search-a-2d-matrix
0088-merge-sorted-array
0090-subsets-ii
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0121-best-time-to-buy-and-sell-stock
0128-longest-consecutive-sequence
0139-word-break
0140-word-break-ii
0152-maximum-product-subarray
0169-majority-element
0198-house-robber
0200-number-of-islands
0215-kth-largest-element-in-an-array
0218-the-skyline-problem
0229-majority-element-ii
0238-product-of-array-except-self
0268-missing-number
0329-longest-increasing-path-in-a-matrix
0347-top-k-frequent-elements
0455-assign-cookies
0539-minimum-time-difference
0645-set-mismatch
0724-find-pivot-index
0733-flood-fill
1319-unique-number-of-occurrences
1325-path-with-maximum-probability
1435-xor-queries-of-a-subarray
1528-kids-with-the-greatest-number-of-candies
1833-find-the-highest-altitude
2006-find-the-student-that-will-replace-the-chalk
2035-count-sub-islands
2132-convert-1d-array-into-2d-array
2155-find-missing-observations
2411-spiral-matrix-iv
2503-longest-subarray-with-maximum-bitwise-and
2553-total-cost-to-hire-k-workers
3501-delete-nodes-from-linked-list-present-in-array

Matrix

0048-rotate-image
0064-minimum-path-sum
0073-set-matrix-zeroes
0074-search-a-2d-matrix
0200-number-of-islands
0329-longest-increasing-path-in-a-matrix
0733-flood-fill
2035-count-sub-islands
2132-convert-1d-array-into-2d-array
2411-spiral-matrix-iv

Graph

0133-clone-graph
0207-course-schedule
0329-longest-increasing-path-in-a-matrix
0801-is-graph-bipartite
0813-all-paths-from-source-to-target
1325-path-with-maximum-probability
1493-frog-position-after-t-seconds
1916-find-center-of-star-graph

Topological Sort

0207-course-schedule
0329-longest-increasing-path-in-a-matrix

Backtracking

0039-combination-sum
0040-combination-sum-ii
0046-permutations
0090-subsets-ii
0131-palindrome-partitioning
0140-word-break-ii
0813-all-paths-from-source-to-target

Stack

0020-valid-parentheses
0042-trapping-rain-water
0114-flatten-binary-tree-to-linked-list
0145-binary-tree-postorder-traversal
0234-palindrome-linked-list
0776-n-ary-tree-postorder-traversal
0937-online-stock-span
1371-minimum-remove-to-make-valid-parentheses

Divide and Conquer

0004-median-of-two-sorted-arrays
0023-merge-k-sorted-lists
0053-maximum-subarray
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0169-majority-element
0215-kth-largest-element-in-an-array
0218-the-skyline-problem
0347-top-k-frequent-elements

Dynamic Programming

0042-trapping-rain-water
0053-maximum-subarray
0062-unique-paths
0064-minimum-path-sum
0070-climbing-stairs
0121-best-time-to-buy-and-sell-stock
0124-binary-tree-maximum-path-sum
0131-palindrome-partitioning
0139-word-break
0140-word-break-ii
0152-maximum-product-subarray
0198-house-robber
0329-longest-increasing-path-in-a-matrix
1250-longest-common-subsequence

Hash Table

0001-two-sum
0041-first-missing-positive
0073-set-matrix-zeroes
0076-minimum-window-substring
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0128-longest-consecutive-sequence
0133-clone-graph
0139-word-break
0140-word-break-ii
0141-linked-list-cycle
0142-linked-list-cycle-ii
0146-lru-cache
0160-intersection-of-two-linked-lists
0169-majority-element
0202-happy-number
0229-majority-element-ii
0268-missing-number
0347-top-k-frequent-elements
0645-set-mismatch
0653-two-sum-iv-input-is-a-bst
0920-uncommon-words-from-two-sentences
1319-unique-number-of-occurrences
1473-find-the-longest-substring-containing-vowels-in-even-counts
3501-delete-nodes-from-linked-list-present-in-array

Union Find

0128-longest-consecutive-sequence
0200-number-of-islands
0801-is-graph-bipartite
2035-count-sub-islands

Two Pointers

0011-container-with-most-water
0019-remove-nth-node-from-end-of-list
0026-remove-duplicates-from-sorted-array
0042-trapping-rain-water
0061-rotate-list
0088-merge-sorted-array
0125-valid-palindrome
0141-linked-list-cycle
0142-linked-list-cycle-ii
0160-intersection-of-two-linked-lists
0165-compare-version-numbers
0202-happy-number
0234-palindrome-linked-list
0295-find-median-from-data-stream
0455-assign-cookies
0653-two-sum-iv-input-is-a-bst
0908-middle-of-the-linked-list
2216-delete-the-middle-node-of-a-linked-list
2553-total-cost-to-hire-k-workers

Greedy

0011-container-with-most-water
0455-assign-cookies

Sorting

0056-merge-intervals
0088-merge-sorted-array
0169-majority-element
0215-kth-largest-element-in-an-array
0229-majority-element-ii
0268-missing-number
0295-find-median-from-data-stream
0347-top-k-frequent-elements
0455-assign-cookies
0539-minimum-time-difference
0645-set-mismatch

Linked List

0002-add-two-numbers
0019-remove-nth-node-from-end-of-list
0023-merge-k-sorted-lists
0025-reverse-nodes-in-k-group
0061-rotate-list
0083-remove-duplicates-from-sorted-list
0092-reverse-linked-list-ii
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0141-linked-list-cycle
0142-linked-list-cycle-ii
0146-lru-cache
0160-intersection-of-two-linked-lists
0234-palindrome-linked-list
0237-delete-node-in-a-linked-list
0328-odd-even-linked-list
0725-split-linked-list-in-parts
0908-middle-of-the-linked-list
1484-linked-list-in-binary-tree
2216-delete-the-middle-node-of-a-linked-list
2411-spiral-matrix-iv
2903-insert-greatest-common-divisors-in-linked-list
3501-delete-nodes-from-linked-list-present-in-array

Math

0002-add-two-numbers
0048-rotate-image
0050-powx-n
0062-unique-paths
0070-climbing-stairs
0202-happy-number
0268-missing-number
0539-minimum-time-difference
2155-find-missing-observations
2903-insert-greatest-common-divisors-in-linked-list

Recursion

0002-add-two-numbers
0025-reverse-nodes-in-k-group
0050-powx-n
0234-palindrome-linked-list

Combinatorics

0062-unique-paths

Counting

0169-majority-element
0229-majority-element-ii
0347-top-k-frequent-elements
0920-uncommon-words-from-two-sentences

Simulation

2006-find-the-student-that-will-replace-the-chalk
2076-sum-of-digits-of-string-after-convert
2132-convert-1d-array-into-2d-array
2155-find-missing-observations
2411-spiral-matrix-iv
2553-total-cost-to-hire-k-workers

Heap (Priority Queue)

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array
0218-the-skyline-problem
0295-find-median-from-data-stream
0347-top-k-frequent-elements
1325-path-with-maximum-probability
2553-total-cost-to-hire-k-workers

Shortest Path

1325-path-with-maximum-probability

Binary Search

0004-median-of-two-sorted-arrays
0074-search-a-2d-matrix
0268-missing-number
2006-find-the-student-that-will-replace-the-chalk

Prefix Sum

0238-product-of-array-except-self
0724-find-pivot-index
1435-xor-queries-of-a-subarray
1473-find-the-longest-substring-containing-vowels-in-even-counts
1833-find-the-highest-altitude
2006-find-the-student-that-will-replace-the-chalk

Monotonic Stack

0042-trapping-rain-water
0937-online-stock-span

String

0006-zigzag-conversion
0020-valid-parentheses
0076-minimum-window-substring
0125-valid-palindrome
0131-palindrome-partitioning
0139-word-break
0140-word-break-ii
0165-compare-version-numbers
0539-minimum-time-difference
0920-uncommon-words-from-two-sentences
1250-longest-common-subsequence
1371-minimum-remove-to-make-valid-parentheses
1473-find-the-longest-substring-containing-vowels-in-even-counts
2076-sum-of-digits-of-string-after-convert

Quickselect

0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements

Design

0146-lru-cache
0295-find-median-from-data-stream
0937-online-stock-span

Data Stream

0295-find-median-from-data-stream
0937-online-stock-span

Bit Manipulation

0090-subsets-ii
0268-missing-number
0645-set-mismatch
1435-xor-queries-of-a-subarray
1473-find-the-longest-substring-containing-vowels-in-even-counts
2323-minimum-bit-flips-to-convert-number
2503-longest-subarray-with-maximum-bitwise-and

Doubly-Linked List

0146-lru-cache

Number Theory

2903-insert-greatest-common-divisors-in-linked-list

Binary Search Tree

0098-validate-binary-search-tree
0108-convert-sorted-array-to-binary-search-tree
0235-lowest-common-ancestor-of-a-binary-search-tree
0653-two-sum-iv-input-is-a-bst
0783-search-in-a-binary-search-tree

Memoization

0070-climbing-stairs
0139-word-break
0140-word-break-ii
0329-longest-increasing-path-in-a-matrix

Brainteaser

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

Merge Sort

0023-merge-k-sorted-lists

Binary Indexed Tree

0218-the-skyline-problem

Segment Tree

0218-the-skyline-problem

Line Sweep

0218-the-skyline-problem

Ordered Set

0218-the-skyline-problem

Sliding Window

0076-minimum-window-substring

Bucket Sort

0347-top-k-frequent-elements

Trie

0139-word-break
0140-word-break-ii
0440-k-th-smallest-in-lexicographical-order

String Matching

0572-subtree-of-another-tree

Hash Function

0572-subtree-of-another-tree

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