Skip to content

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

rohit141914/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 v2

Array

0503-next-greater-element-ii

Stack

0503-next-greater-element-ii

Monotonic Stack

0503-next-greater-element-ii

LeetCode Topics

Array

0045-jump-game-ii
0055-jump-game
0056-merge-intervals
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0118-pascals-triangle
0121-best-time-to-buy-and-sell-stock
0162-find-peak-element
0217-contains-duplicate
0219-contains-duplicate-ii
0300-longest-increasing-subsequence
0322-coin-change
0334-increasing-triplet-subsequence
0350-intersection-of-two-arrays-ii
0435-non-overlapping-intervals
0448-find-all-numbers-disappeared-in-an-array
0452-minimum-number-of-arrows-to-burst-balloons
0518-coin-change-ii
0524-longest-word-in-dictionary-through-deleting
0566-reshape-the-matrix
0646-maximum-length-of-pair-chain
0665-non-decreasing-array
0673-number-of-longest-increasing-subsequence
0674-longest-continuous-increasing-subsequence
0682-baseball-game
0720-longest-word-in-dictionary
0745-find-smallest-letter-greater-than-target
0748-largest-number-at-least-twice-of-others
0875-longest-mountain-in-array
0882-peak-index-in-a-mountain-array
0890-lemonade-change
0952-word-subsets
0958-sort-array-by-parity-ii
0978-valid-mountain-array
1002-maximum-width-ramp
1062-partition-array-into-three-parts-with-equal-sum
1071-binary-prefix-divisible-by-5
1127-last-stone-weight
1185-find-in-mountain-array
1256-rank-transform-of-an-array
1293-three-consecutive-odds
1353-find-resultant-array-after-removing-anagrams
1354-find-players-with-zero-or-one-losses
1355-minimum-deletions-to-make-array-beautiful
1468-check-if-n-and-its-double-exist
1496-lucky-numbers-in-a-matrix
1524-string-matching-in-an-array
1538-maximum-points-you-can-obtain-from-cards
1556-make-two-arrays-equal-by-reversing-subarrays
1570-final-prices-with-a-special-discount-in-a-shop
1620-check-if-array-pairs-are-divisible-by-k
1755-defuse-the-bomb
1766-minimum-number-of-removals-to-make-mountain-array
1786-count-the-number-of-consistent-strings
1829-maximum-units-on-a-truck
1923-sentence-similarity-iii
1988-minimize-maximum-pair-sum-in-array
2093-check-if-string-is-a-prefix-of-array
2102-find-the-middle-index-in-array
2122-count-special-quadruplets
2132-convert-1d-array-into-2d-array
2204-find-subsequence-of-length-k-with-the-largest-sum
2205-find-good-days-to-rob-the-bank
2232-adding-spaces-to-a-string
2244-number-of-laser-beams-in-a-bank
2254-check-if-every-row-and-column-contains-all-numbers
2265-partition-array-according-to-given-pivot
2271-rearrange-array-elements-by-sign
2274-keep-multiplying-found-values-by-two
2283-sort-even-and-odd-indices-independently
2292-counting-words-with-a-given-prefix
2331-intersection-of-multiple-arrays
2341-count-prefixes-of-a-given-string
2358-number-of-ways-to-split-array
2366-maximum-bags-with-full-capacity-of-rocks
2411-spiral-matrix-iv
2436-make-array-zero-by-subtracting-equal-amounts
2465-shifting-letters-ii
2497-maximum-matching-of-players-with-trainers
2504-find-all-good-indices
2533-bitwise-xor-of-all-pairings
2536-determine-if-two-events-have-conflict
2542-average-value-of-even-numbers-that-are-divisible-by-three
2551-apply-operations-to-an-array
2581-divide-players-into-teams-of-equal-skill
2606-difference-between-ones-and-zeros-in-row-and-column
2669-find-the-substring-with-maximum-cost
2685-first-completely-painted-row-or-column
2691-count-vowel-strings-in-ranges
2721-sum-of-distances
2727-number-of-senior-citizens
3114-beautiful-towers-i
3309-count-prefix-and-suffix-pairs-i
3469-maximum-height-of-a-triangle
3476-find-minimum-operations-to-make-all-elements-divisible-by-three
3515-find-if-digit-game-can-be-won
3581-the-two-sneaky-numbers-of-digitville
3582-find-indices-of-stable-mountains
3647-zero-array-transformation-iii

Hash Table

0003-longest-substring-without-repeating-characters
0012-integer-to-roman
0013-roman-to-integer
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0142-linked-list-cycle-ii
0217-contains-duplicate
0219-contains-duplicate-ii
0242-valid-anagram
0350-intersection-of-two-arrays-ii
0448-find-all-numbers-disappeared-in-an-array
0676-implement-magic-dictionary
0720-longest-word-in-dictionary
0920-uncommon-words-from-two-sentences
0952-word-subsets
1029-vertical-order-traversal-of-a-binary-tree
1256-rank-transform-of-an-array
1353-find-resultant-array-after-removing-anagrams
1354-find-players-with-zero-or-one-losses
1468-check-if-n-and-its-double-exist
1469-minimum-number-of-steps-to-make-two-strings-anagram
1502-construct-k-palindrome-strings
1556-make-two-arrays-equal-by-reversing-subarrays
1620-check-if-array-pairs-are-divisible-by-k
1786-count-the-number-of-consistent-strings
1915-check-if-one-string-swap-can-make-strings-equal
2122-count-special-quadruplets
2204-find-subsequence-of-length-k-with-the-largest-sum
2254-check-if-every-row-and-column-contains-all-numbers
2274-keep-multiplying-found-values-by-two
2293-minimum-number-of-steps-to-make-two-strings-anagram-ii
2331-intersection-of-multiple-arrays
2436-make-array-zero-by-subtracting-equal-amounts
2581-divide-players-into-teams-of-equal-skill
2669-find-the-substring-with-maximum-cost
2677-cousins-in-binary-tree-ii
2685-first-completely-painted-row-or-column
2721-sum-of-distances
3412-permutation-difference-between-two-strings
3455-minimum-length-of-string-after-operations
3581-the-two-sneaky-numbers-of-digitville

Two Pointers

0028-find-the-index-of-the-first-occurrence-in-a-string
0061-rotate-list
0086-partition-list
0142-linked-list-cycle-ii
0143-reorder-list
0295-find-median-from-data-stream
0350-intersection-of-two-arrays-ii
0443-string-compression
0524-longest-word-in-dictionary-through-deleting
0875-longest-mountain-in-array
0958-sort-array-by-parity-ii
0961-long-pressed-name
1468-check-if-n-and-its-double-exist
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1894-merge-strings-alternately
1923-sentence-similarity-iii
1988-minimize-maximum-pair-sum-in-array
2093-check-if-string-is-a-prefix-of-array
2095-minimum-number-of-swaps-to-make-the-string-balanced
2128-reverse-prefix-of-word
2232-adding-spaces-to-a-string
2265-partition-array-according-to-given-pivot
2271-rearrange-array-elements-by-sign
2497-maximum-matching-of-players-with-trainers
2551-apply-operations-to-an-array
2581-divide-players-into-teams-of-equal-skill
3018-make-string-a-subsequence-using-cyclic-increments

Binary Search

0162-find-peak-element
0300-longest-increasing-subsequence
0350-intersection-of-two-arrays-ii
0745-find-smallest-letter-greater-than-target
0882-peak-index-in-a-mountain-array
1185-find-in-mountain-array
1468-check-if-n-and-its-double-exist
1766-minimum-number-of-removals-to-make-mountain-array

Sorting

0056-merge-intervals
0217-contains-duplicate
0242-valid-anagram
0295-find-median-from-data-stream
0350-intersection-of-two-arrays-ii
0435-non-overlapping-intervals
0452-minimum-number-of-arrows-to-burst-balloons
0524-longest-word-in-dictionary-through-deleting
0646-maximum-length-of-pair-chain
0720-longest-word-in-dictionary
0748-largest-number-at-least-twice-of-others
0958-sort-array-by-parity-ii
1029-vertical-order-traversal-of-a-binary-tree
1256-rank-transform-of-an-array
1353-find-resultant-array-after-removing-anagrams
1354-find-players-with-zero-or-one-losses
1468-check-if-n-and-its-double-exist
1556-make-two-arrays-equal-by-reversing-subarrays
1829-maximum-units-on-a-truck
1970-sorting-the-sentence
1988-minimize-maximum-pair-sum-in-array
2204-find-subsequence-of-length-k-with-the-largest-sum
2274-keep-multiplying-found-values-by-two
2283-sort-even-and-odd-indices-independently
2327-largest-number-after-digit-swaps-by-parity
2331-intersection-of-multiple-arrays
2366-maximum-bags-with-full-capacity-of-rocks
2436-make-array-zero-by-subtracting-equal-amounts
2497-maximum-matching-of-players-with-trainers
2581-divide-players-into-teams-of-equal-skill
2646-kth-largest-sum-in-a-binary-tree
3647-zero-array-transformation-iii

Counting

0920-uncommon-words-from-two-sentences
1354-find-players-with-zero-or-one-losses
1469-minimum-number-of-steps-to-make-two-strings-anagram
1502-construct-k-palindrome-strings
1620-check-if-array-pairs-are-divisible-by-k
1786-count-the-number-of-consistent-strings
1915-check-if-one-string-swap-can-make-strings-equal
2293-minimum-number-of-steps-to-make-two-strings-anagram-ii
2331-intersection-of-multiple-arrays
3455-minimum-length-of-string-after-operations

Matrix

0566-reshape-the-matrix
1496-lucky-numbers-in-a-matrix
2132-convert-1d-array-into-2d-array
2244-number-of-laser-beams-in-a-bank
2254-check-if-every-row-and-column-contains-all-numbers
2411-spiral-matrix-iv
2606-difference-between-ones-and-zeros-in-row-and-column
2685-first-completely-painted-row-or-column

String

0003-longest-substring-without-repeating-characters
0006-zigzag-conversion
0008-string-to-integer-atoi
0012-integer-to-roman
0013-roman-to-integer
0028-find-the-index-of-the-first-occurrence-in-a-string
0072-edit-distance
0242-valid-anagram
0443-string-compression
0516-longest-palindromic-subsequence
0524-longest-word-in-dictionary-through-deleting
0583-delete-operation-for-two-strings
0676-implement-magic-dictionary
0720-longest-word-in-dictionary
0812-rotate-string
0920-uncommon-words-from-two-sentences
0952-word-subsets
0957-minimum-add-to-make-parentheses-valid
0961-long-pressed-name
1302-delete-characters-to-make-fancy-string
1353-find-resultant-array-after-removing-anagrams
1469-minimum-number-of-steps-to-make-two-strings-anagram
1502-construct-k-palindrome-strings
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1542-consecutive-characters
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1636-number-of-substrings-with-only-1s
1786-count-the-number-of-consistent-strings
1885-count-number-of-homogenous-substrings
1894-merge-strings-alternately
1915-check-if-one-string-swap-can-make-strings-equal
1923-sentence-similarity-iii
1970-sorting-the-sentence
2076-sum-of-digits-of-string-after-convert
2088-minimum-time-to-type-word-using-special-typewriter
2093-check-if-string-is-a-prefix-of-array
2095-minimum-number-of-swaps-to-make-the-string-balanced
2128-reverse-prefix-of-word
2168-check-if-numbers-are-ascending-in-a-sentence
2232-adding-spaces-to-a-string
2243-check-if-all-as-appears-before-all-bs
2244-number-of-laser-beams-in-a-bank
2292-counting-words-with-a-given-prefix
2293-minimum-number-of-steps-to-make-two-strings-anagram-ii
2304-cells-in-a-range-on-an-excel-sheet
2341-count-prefixes-of-a-given-string
2465-shifting-letters-ii
2536-determine-if-two-events-have-conflict
2580-circular-sentence
2669-find-the-substring-with-maximum-cost
2691-count-vowel-strings-in-ranges
2727-number-of-senior-citizens
2800-minimum-string-length-after-removing-substrings
3018-make-string-a-subsequence-using-cyclic-increments
3309-count-prefix-and-suffix-pairs-i
3412-permutation-difference-between-two-strings
3447-clear-digits
3451-string-compression-iii
3455-minimum-length-of-string-after-operations
3636-check-balanced-string

Math

0012-integer-to-roman
0013-roman-to-integer
1636-number-of-substrings-with-only-1s
1885-count-number-of-homogenous-substrings
2244-number-of-laser-beams-in-a-bank
2542-average-value-of-even-numbers-that-are-divisible-by-three
2903-insert-greatest-common-divisors-in-linked-list
3371-harshad-number
3476-find-minimum-operations-to-make-all-elements-divisible-by-three
3515-find-if-digit-game-can-be-won
3581-the-two-sneaky-numbers-of-digitville
3600-find-the-k-th-character-in-string-game-i

Greedy

0045-jump-game-ii
0055-jump-game
0334-increasing-triplet-subsequence
0435-non-overlapping-intervals
0452-minimum-number-of-arrows-to-burst-balloons
0646-maximum-length-of-pair-chain
0890-lemonade-change
0957-minimum-add-to-make-parentheses-valid
1062-partition-array-into-three-parts-with-equal-sum
1355-minimum-deletions-to-make-array-beautiful
1502-construct-k-palindrome-strings
1766-minimum-number-of-removals-to-make-mountain-array
1829-maximum-units-on-a-truck
1988-minimize-maximum-pair-sum-in-array
2088-minimum-time-to-type-word-using-special-typewriter
2095-minimum-number-of-swaps-to-make-the-string-balanced
2366-maximum-bags-with-full-capacity-of-rocks
2436-make-array-zero-by-subtracting-equal-amounts
2497-maximum-matching-of-players-with-trainers
3647-zero-array-transformation-iii

Bit Manipulation

0476-number-complement
1071-binary-prefix-divisible-by-5
1786-count-the-number-of-consistent-strings
2323-minimum-bit-flips-to-convert-number
2533-bitwise-xor-of-all-pairings
3600-find-the-k-th-character-in-string-game-i

Stack

0143-reorder-list
0145-binary-tree-postorder-traversal
0225-implement-stack-using-queues
0232-implement-queue-using-stacks
0682-baseball-game
0957-minimum-add-to-make-parentheses-valid
1002-maximum-width-ramp
1355-minimum-deletions-to-make-array-beautiful
1570-final-prices-with-a-special-discount-in-a-shop
2095-minimum-number-of-swaps-to-make-the-string-balanced
2128-reverse-prefix-of-word
2800-minimum-string-length-after-removing-substrings
3114-beautiful-towers-i
3447-clear-digits

Tree

0105-construct-binary-tree-from-preorder-and-inorder-traversal
0110-balanced-binary-tree
0145-binary-tree-postorder-traversal
0226-invert-binary-tree
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0404-sum-of-left-leaves
0515-find-largest-value-in-each-tree-row
1029-vertical-order-traversal-of-a-binary-tree
1035-cousins-in-binary-tree
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Depth-First Search

0110-balanced-binary-tree
0145-binary-tree-postorder-traversal
0226-invert-binary-tree
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0404-sum-of-left-leaves
0515-find-largest-value-in-each-tree-row
0676-implement-magic-dictionary
1029-vertical-order-traversal-of-a-binary-tree
1035-cousins-in-binary-tree
2493-reverse-odd-levels-of-binary-tree
2677-cousins-in-binary-tree-ii

Binary Tree

0105-construct-binary-tree-from-preorder-and-inorder-traversal
0110-balanced-binary-tree
0145-binary-tree-postorder-traversal
0226-invert-binary-tree
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0404-sum-of-left-leaves
0515-find-largest-value-in-each-tree-row
1029-vertical-order-traversal-of-a-binary-tree
1035-cousins-in-binary-tree
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Simulation

0566-reshape-the-matrix
0682-baseball-game
2076-sum-of-digits-of-string-after-convert
2132-convert-1d-array-into-2d-array
2232-adding-spaces-to-a-string
2265-partition-array-according-to-given-pivot
2271-rearrange-array-elements-by-sign
2274-keep-multiplying-found-values-by-two
2411-spiral-matrix-iv
2436-make-array-zero-by-subtracting-equal-amounts
2551-apply-operations-to-an-array
2606-difference-between-ones-and-zeros-in-row-and-column
2800-minimum-string-length-after-removing-substrings
3447-clear-digits
3600-find-the-k-th-character-in-string-game-i

Linked List

0023-merge-k-sorted-lists
0061-rotate-list
0086-partition-list
0142-linked-list-cycle-ii
0143-reorder-list
2411-spiral-matrix-iv
2903-insert-greatest-common-divisors-in-linked-list

Number Theory

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

Sliding Window

0003-longest-substring-without-repeating-characters
0219-contains-duplicate-ii
1538-maximum-points-you-can-obtain-from-cards
1755-defuse-the-bomb

Monotonic Stack

1002-maximum-width-ramp
1570-final-prices-with-a-special-discount-in-a-shop
3114-beautiful-towers-i

Dynamic Programming

0045-jump-game-ii
0055-jump-game
0072-edit-distance
0118-pascals-triangle
0121-best-time-to-buy-and-sell-stock
0300-longest-increasing-subsequence
0322-coin-change
0435-non-overlapping-intervals
0516-longest-palindromic-subsequence
0518-coin-change-ii
0583-delete-operation-for-two-strings
0646-maximum-length-of-pair-chain
0673-number-of-longest-increasing-subsequence
0875-longest-mountain-in-array
1766-minimum-number-of-removals-to-make-mountain-array
2205-find-good-days-to-rob-the-bank
2504-find-all-good-indices
2669-find-the-substring-with-maximum-cost

Breadth-First Search

0226-invert-binary-tree
0322-coin-change
0404-sum-of-left-leaves
0515-find-largest-value-in-each-tree-row
1029-vertical-order-traversal-of-a-binary-tree
1035-cousins-in-binary-tree
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
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

Database

0197-rising-temperature
0577-employee-bonus
0584-find-customer-referee
0595-big-countries
1724-customer-who-visited-but-did-not-make-any-transactions
1827-invalid-tweets
1908-recyclable-and-low-fat-products

Design

0225-implement-stack-using-queues
0232-implement-queue-using-stacks
0295-find-median-from-data-stream
0676-implement-magic-dictionary

Queue

0225-implement-stack-using-queues
0232-implement-queue-using-stacks

Trie

0676-implement-magic-dictionary
0720-longest-word-in-dictionary
3309-count-prefix-and-suffix-pairs-i

Prefix Sum

1537-maximum-score-after-splitting-a-string
1538-maximum-points-you-can-obtain-from-cards
2102-find-the-middle-index-in-array
2205-find-good-days-to-rob-the-bank
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
2504-find-all-good-indices
2691-count-vowel-strings-in-ranges
2721-sum-of-distances
3647-zero-array-transformation-iii

Heap (Priority Queue)

0023-merge-k-sorted-lists
0295-find-median-from-data-stream
1127-last-stone-weight
2204-find-subsequence-of-length-k-with-the-largest-sum
2327-largest-number-after-digit-swaps-by-parity
2436-make-array-zero-by-subtracting-equal-amounts
3647-zero-array-transformation-iii

Recursion

0143-reorder-list
3600-find-the-k-th-character-in-string-game-i

Data Stream

0295-find-median-from-data-stream

Divide and Conquer

0023-merge-k-sorted-lists
0105-construct-binary-tree-from-preorder-and-inorder-traversal

Binary Search Tree

0235-lowest-common-ancestor-of-a-binary-search-tree

Rolling Hash

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

Hash Function

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

Enumeration

0875-longest-mountain-in-array
2122-count-special-quadruplets
3469-maximum-height-of-a-triangle

Merge Sort

0023-merge-k-sorted-lists

Interactive

1185-find-in-mountain-array

Binary Indexed Tree

0673-number-of-longest-increasing-subsequence

Segment Tree

0673-number-of-longest-increasing-subsequence

Brainteaser

2533-bitwise-xor-of-all-pairings

About

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