Skip to content

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

Notifications You must be signed in to change notification settings

mohit1721/Leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode

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

LeetCode Topics

Math

0007-reverse-integer
0013-roman-to-integer
0050-powx-n
0062-unique-paths
0202-happy-number
0371-sum-of-two-integers
1421-find-numbers-with-even-number-of-digits
1477-product-of-the-last-k-numbers
2432-number-of-zero-filled-subarrays
2448-count-number-of-bad-pairs
3227-find-missing-and-repeated-values
3555-final-array-state-after-k-multiplication-operations-i

Recursion

0025-reverse-nodes-in-k-group
0050-powx-n

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0026-remove-duplicates-from-sorted-array
0033-search-in-rotated-sorted-array
0039-combination-sum
0040-combination-sum-ii
0046-permutations
0053-maximum-subarray
0063-unique-paths-ii
0064-minimum-path-sum
0074-search-a-2d-matrix
0081-search-in-rotated-sorted-array-ii
0084-largest-rectangle-in-histogram
0090-subsets-ii
0120-triangle
0128-longest-consecutive-sequence
0152-maximum-product-subarray
0153-find-minimum-in-rotated-sorted-array
0213-house-robber-ii
0215-kth-largest-element-in-an-array
0238-product-of-array-except-self
0239-sliding-window-maximum
0347-top-k-frequent-elements
0407-trapping-rain-water-ii
0455-assign-cookies
0485-max-consecutive-ones
0560-subarray-sum-equals-k
0740-delete-and-earn
0780-max-chunks-to-make-sorted
0854-making-a-large-island
1335-maximum-candies-allocated-to-k-children
1421-find-numbers-with-even-number-of-digits
1477-product-of-the-last-k-numbers
1524-string-matching-in-an-array
1538-maximum-points-you-can-obtain-from-cards
1570-final-prices-with-a-special-discount-in-a-shop
1675-magnetic-force-between-two-balls
1876-map-of-highest-peak
1878-check-if-array-is-sorted-and-rotated
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2048-build-array-from-permutation
2145-grid-game
2265-partition-array-according-to-given-pivot
2277-count-equal-and-divisible-pairs-in-an-array
2292-counting-words-with-a-given-prefix
2294-minimum-time-to-complete-trips
2358-number-of-ways-to-split-array
2394-count-subarrays-with-score-less-than-k
2432-number-of-zero-filled-subarrays
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2486-most-frequent-even-element
2527-count-subarrays-with-fixed-bounds
2533-bitwise-xor-of-all-pairings
2551-apply-operations-to-an-array
2614-maximum-count-of-positive-integer-and-negative-integer
2626-count-the-number-of-good-subarrays
2691-count-vowel-strings-in-ranges
2764-maximum-number-of-fish-in-a-grid
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
2856-count-complete-subarrays-in-an-array
3213-count-subarrays-where-max-element-appears-at-least-k-times
3219-make-lexicographically-smallest-array-by-swapping-elements
3227-find-missing-and-repeated-values
3332-minimum-operations-to-exceed-threshold-value-ii
3429-special-array-i
3434-find-the-number-of-distinct-colors-among-the-balls
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii
3555-final-array-state-after-k-multiplication-operations-i
3627-find-minimum-time-to-reach-last-room-i
3656-minimum-number-of-operations-to-make-elements-in-array-distinct
3685-count-subarrays-of-length-three-with-a-condition

Binary Search

0004-median-of-two-sorted-arrays
0033-search-in-rotated-sorted-array
0074-search-a-2d-matrix
0081-search-in-rotated-sorted-array-ii
0153-find-minimum-in-rotated-sorted-array
1335-maximum-candies-allocated-to-k-children
1675-magnetic-force-between-two-balls
2294-minimum-time-to-complete-trips
2394-count-subarrays-with-score-less-than-k
2614-maximum-count-of-positive-integer-and-negative-integer

Matrix

0063-unique-paths-ii
0064-minimum-path-sum
0074-search-a-2d-matrix
0407-trapping-rain-water-ii
0854-making-a-large-island
1876-map-of-highest-peak
2145-grid-game
2764-maximum-number-of-fish-in-a-grid
3227-find-missing-and-repeated-values
3627-find-minimum-time-to-reach-last-room-i

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0013-roman-to-integer
0128-longest-consecutive-sequence
0202-happy-number
0242-valid-anagram
0347-top-k-frequent-elements
0560-subarray-sum-equals-k
0740-delete-and-earn
1160-letter-tile-possibilities
1460-number-of-substrings-containing-all-three-characters
1502-construct-k-palindrome-strings
2059-unique-length-3-palindromic-subsequences
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2486-most-frequent-even-element
2626-count-the-number-of-good-subarrays
2766-find-the-prefix-common-array-of-two-arrays
2856-count-complete-subarrays-in-an-array
3227-find-missing-and-repeated-values
3434-find-the-number-of-distinct-colors-among-the-balls
3455-minimum-length-of-string-after-operations
3656-minimum-number-of-operations-to-make-elements-in-array-distinct

Counting

0347-top-k-frequent-elements
1160-letter-tile-possibilities
1502-construct-k-palindrome-strings
2448-count-number-of-bad-pairs
2486-most-frequent-even-element
2614-maximum-count-of-positive-integer-and-negative-integer
3455-minimum-length-of-string-after-operations

Heap (Priority Queue)

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array
0239-sliding-window-maximum
0347-top-k-frequent-elements
0407-trapping-rain-water-ii
2473-max-sum-of-a-pair-with-equal-sum-of-digits
3332-minimum-operations-to-exceed-threshold-value-ii
3555-final-array-state-after-k-multiplication-operations-i
3627-find-minimum-time-to-reach-last-room-i

Simulation

2021-remove-all-occurrences-of-a-substring
2048-build-array-from-permutation
2265-partition-array-according-to-given-pivot
2551-apply-operations-to-an-array
3332-minimum-operations-to-exceed-threshold-value-ii
3434-find-the-number-of-distinct-colors-among-the-balls
3447-clear-digits
3555-final-array-state-after-k-multiplication-operations-i

Dynamic Programming

0005-longest-palindromic-substring
0053-maximum-subarray
0062-unique-paths
0063-unique-paths-ii
0064-minimum-path-sum
0120-triangle
0152-maximum-product-subarray
0213-house-robber-ii
0740-delete-and-earn
0806-domino-and-tromino-tiling

Combinatorics

0062-unique-paths

Stack

0020-valid-parentheses
0084-largest-rectangle-in-histogram
0225-implement-stack-using-queues
0780-max-chunks-to-make-sorted
1570-final-prices-with-a-special-discount-in-a-shop
2021-remove-all-occurrences-of-a-substring
2221-check-if-a-parentheses-string-can-be-valid
3447-clear-digits

Monotonic Stack

0084-largest-rectangle-in-histogram
0780-max-chunks-to-make-sorted
1570-final-prices-with-a-special-discount-in-a-shop

Union Find

0128-longest-consecutive-sequence
0684-redundant-connection
0854-making-a-large-island
2764-maximum-number-of-fish-in-a-grid
3219-make-lexicographically-smallest-array-by-swapping-elements

Two Pointers

0005-longest-palindromic-substring
0026-remove-duplicates-from-sorted-array
0028-find-the-index-of-the-first-occurrence-in-a-string
0151-reverse-words-in-a-string
0202-happy-number
0455-assign-cookies
2265-partition-array-according-to-given-pivot
2551-apply-operations-to-an-array

Greedy

0455-assign-cookies
0780-max-chunks-to-make-sorted
1502-construct-k-palindrome-strings
2221-check-if-a-parentheses-string-can-be-valid

Sorting

0215-kth-largest-element-in-an-array
0242-valid-anagram
0347-top-k-frequent-elements
0455-assign-cookies
0780-max-chunks-to-make-sorted
1675-magnetic-force-between-two-balls
2473-max-sum-of-a-pair-with-equal-sum-of-digits
3219-make-lexicographically-smallest-array-by-swapping-elements

Tree

0515-find-largest-value-in-each-tree-row
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level

Depth-First Search

0515-find-largest-value-in-each-tree-row
0684-redundant-connection
0820-find-eventual-safe-states
0854-making-a-large-island
2246-maximum-employees-to-be-invited-to-a-meeting
2493-reverse-odd-levels-of-binary-tree
2764-maximum-number-of-fish-in-a-grid

Breadth-First Search

0407-trapping-rain-water-ii
0515-find-largest-value-in-each-tree-row
0684-redundant-connection
0820-find-eventual-safe-states
0854-making-a-large-island
1876-map-of-highest-peak
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
2764-maximum-number-of-fish-in-a-grid

Binary Tree

0515-find-largest-value-in-each-tree-row
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0013-roman-to-integer
0014-longest-common-prefix
0020-valid-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0151-reverse-words-in-a-string
0242-valid-anagram
1160-letter-tile-possibilities
1460-number-of-substrings-containing-all-three-characters
1502-construct-k-palindrome-strings
1524-string-matching-in-an-array
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2021-remove-all-occurrences-of-a-substring
2059-unique-length-3-palindromic-subsequences
2221-check-if-a-parentheses-string-can-be-valid
2292-counting-words-with-a-given-prefix
2463-minimum-recolors-to-get-k-consecutive-black-blocks
2691-count-vowel-strings-in-ranges
3447-clear-digits
3455-minimum-length-of-string-after-operations

Prefix Sum

0238-product-of-array-except-self
0560-subarray-sum-equals-k
1477-product-of-the-last-k-numbers
1538-maximum-points-you-can-obtain-from-cards
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2059-unique-length-3-palindromic-subsequences
2145-grid-game
2358-number-of-ways-to-split-array
2394-count-subarrays-with-score-less-than-k
2691-count-vowel-strings-in-ranges
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

Bit Manipulation

0090-subsets-ii
0371-sum-of-two-integers
2059-unique-length-3-palindromic-subsequences
2533-bitwise-xor-of-all-pairings
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
1524-string-matching-in-an-array
2292-counting-words-with-a-given-prefix

Brainteaser

2533-bitwise-xor-of-all-pairings

Backtracking

0039-combination-sum
0040-combination-sum-ii
0046-permutations
0090-subsets-ii
1160-letter-tile-possibilities

Divide and Conquer

0004-median-of-two-sorted-arrays
0023-merge-k-sorted-lists
0053-maximum-subarray
0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements

Quickselect

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

Bucket Sort

0347-top-k-frequent-elements

Linked List

0023-merge-k-sorted-lists
0025-reverse-nodes-in-k-group

Merge Sort

0023-merge-k-sorted-lists

Trie

0014-longest-common-prefix

Graph

0684-redundant-connection
0820-find-eventual-safe-states
2246-maximum-employees-to-be-invited-to-a-meeting
3627-find-minimum-time-to-reach-last-room-i

Topological Sort

0820-find-eventual-safe-states
2246-maximum-employees-to-be-invited-to-a-meeting

Design

0225-implement-stack-using-queues
1477-product-of-the-last-k-numbers

Queue

0225-implement-stack-using-queues
0239-sliding-window-maximum
2527-count-subarrays-with-fixed-bounds
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

Data Stream

1477-product-of-the-last-k-numbers

Sliding Window

0003-longest-substring-without-repeating-characters
0239-sliding-window-maximum
1460-number-of-substrings-containing-all-three-characters
1538-maximum-points-you-can-obtain-from-cards
2394-count-subarrays-with-score-less-than-k
2463-minimum-recolors-to-get-k-consecutive-black-blocks
2527-count-subarrays-with-fixed-bounds
2626-count-the-number-of-good-subarrays
2856-count-complete-subarrays-in-an-array
3213-count-subarrays-where-max-element-appears-at-least-k-times
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii

Monotonic Queue

0239-sliding-window-maximum
2527-count-subarrays-with-fixed-bounds

Shortest Path

3627-find-minimum-time-to-reach-last-room-i

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages