Skip to content

Latest commit

 

History

506 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode

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

LeetCode Topics

String

0125-valid-palindrome
0299-bulls-and-cows
0344-reverse-string
0387-first-unique-character-in-a-string
0402-remove-k-digits
0409-longest-palindrome
0420-strong-password-checker
0443-string-compression
0449-serialize-and-deserialize-bst
0451-sort-characters-by-frequency
0564-find-the-closest-palindrome
0692-top-k-frequent-words
0753-cracking-the-safe
0767-reorganize-string
1044-longest-duplicate-substring
1967-number-of-strings-that-appear-as-substrings-in-word
2486-append-characters-to-string-to-make-subsequence

Stack

0143-reorder-list
0173-binary-search-tree-iterator
0402-remove-k-digits
0581-shortest-unsorted-continuous-subarray
2487-remove-nodes-from-linked-list
2617-minimum-number-of-visited-cells-in-a-grid

Greedy

0330-patching-array
0402-remove-k-digits
0409-longest-palindrome
0420-strong-password-checker
0435-non-overlapping-intervals
0455-assign-cookies
0502-ipo
0517-super-washing-machines
0561-array-partition
0581-shortest-unsorted-continuous-subarray
0765-couples-holding-hands
0767-reorganize-string
0807-max-increase-to-keep-city-skyline
0861-score-after-flipping-matrix
1090-largest-values-from-labels
1253-reconstruct-a-2-row-binary-matrix
1846-maximum-element-after-decreasing-and-rearranging
2486-append-characters-to-string-to-make-subsequence
2966-divide-array-into-arrays-with-max-difference

Monotonic Stack

0402-remove-k-digits
0581-shortest-unsorted-continuous-subarray
2487-remove-nodes-from-linked-list
2617-minimum-number-of-visited-cells-in-a-grid

Heap (Priority Queue)

0347-top-k-frequent-elements
0420-strong-password-checker
0451-sort-characters-by-frequency
0502-ipo
0675-cut-off-trees-for-golf-event
0692-top-k-frequent-words
0743-network-delay-time
0767-reorganize-string
0882-reachable-nodes-in-subdivided-graph
1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1464-maximum-product-of-two-elements-in-an-array
2617-minimum-number-of-visited-cells-in-a-grid
2812-find-the-safest-path-in-a-grid
3620-network-recovery-pathways

Linked List

0109-convert-sorted-list-to-binary-search-tree
0141-linked-list-cycle
0143-reorder-list
0146-lru-cache
0148-sort-list
0460-lfu-cache
2487-remove-nodes-from-linked-list

Divide and Conquer

0109-convert-sorted-list-to-binary-search-tree
0148-sort-list
0307-range-sum-query-mutable
0347-top-k-frequent-elements
3737-count-subarrays-with-majority-element-i

Tree

0109-convert-sorted-list-to-binary-search-tree
0173-binary-search-tree-iterator
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0449-serialize-and-deserialize-bst
0834-sum-of-distances-in-tree

Binary Search Tree

0109-convert-sorted-list-to-binary-search-tree
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0173-binary-search-tree-iterator
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0268-missing-number
0275-h-index-ii
0287-find-the-duplicate-number
0300-longest-increasing-subsequence
0449-serialize-and-deserialize-bst
1044-longest-duplicate-substring
1201-ugly-number-iii
2812-find-the-safest-path-in-a-grid
3532-path-existence-queries-in-a-graph-i
3620-network-recovery-pathways

Binary Tree

0109-convert-sorted-list-to-binary-search-tree
0173-binary-search-tree-iterator
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0449-serialize-and-deserialize-bst

Math

0202-happy-number
0223-rectangle-area
0258-add-digits
0268-missing-number
0564-find-the-closest-palindrome
0840-magic-squares-in-grid
0869-reordered-power-of-2
0892-surface-area-of-3d-shapes
0913-cat-and-mouse
0914-x-of-a-kind-in-a-deck-of-cards
0920-number-of-music-playlists
1201-ugly-number-iii
1359-count-all-valid-pickup-and-delivery-options
1823-find-the-winner-of-the-circular-game
2485-find-the-pivot-integer
3025-find-the-number-of-ways-to-place-people-i
3047-find-the-largest-area-of-square-inside-two-rectangles
3272-find-the-count-of-good-integers
3345-smallest-divisible-digit-product-i
3658-gcd-of-odd-and-even-sums
3700-number-of-zigzag-arrays-ii

Dynamic Programming

0300-longest-increasing-subsequence
0435-non-overlapping-intervals
0741-cherry-pickup
0834-sum-of-distances-in-tree
0847-shortest-path-visiting-all-nodes
0913-cat-and-mouse
0920-number-of-music-playlists
0931-minimum-falling-path-sum
1139-largest-1-bordered-square
1162-as-far-from-land-as-possible
1359-count-all-valid-pickup-and-delivery-options
1395-count-number-of-teams
2617-minimum-number-of-visited-cells-in-a-grid
3620-network-recovery-pathways
3700-number-of-zigzag-arrays-ii

Design

0146-lru-cache
0173-binary-search-tree-iterator
0307-range-sum-query-mutable
0449-serialize-and-deserialize-bst
0460-lfu-cache

Iterator

0173-binary-search-tree-iterator

Depth-First Search

0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0449-serialize-and-deserialize-bst
0695-max-area-of-island
0743-network-delay-time
0749-contain-virus
0753-cracking-the-safe
0765-couples-holding-hands
0785-is-graph-bipartite
0834-sum-of-distances-in-tree
0841-keys-and-rooms
0851-loud-and-rich
0886-possible-bipartition
0924-minimize-malware-spread
0959-regions-cut-by-slashes
1020-number-of-enclaves
1034-coloring-a-border
1254-number-of-closed-islands
1267-count-servers-that-communicate
2685-count-the-number-of-complete-components

Breadth-First Search

0449-serialize-and-deserialize-bst
0675-cut-off-trees-for-golf-event
0695-max-area-of-island
0743-network-delay-time
0749-contain-virus
0765-couples-holding-hands
0785-is-graph-bipartite
0841-keys-and-rooms
0847-shortest-path-visiting-all-nodes
0886-possible-bipartition
0909-snakes-and-ladders
0924-minimize-malware-spread
0959-regions-cut-by-slashes
1020-number-of-enclaves
1034-coloring-a-border
1091-shortest-path-in-binary-matrix
1162-as-far-from-land-as-possible
1254-number-of-closed-islands
1267-count-servers-that-communicate
1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2039-the-time-when-the-network-becomes-idle
2617-minimum-number-of-visited-cells-in-a-grid
2685-count-the-number-of-complete-components
2812-find-the-safest-path-in-a-grid

Array

0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0229-majority-element-ii
0268-missing-number
0275-h-index-ii
0283-move-zeroes
0287-find-the-duplicate-number
0300-longest-increasing-subsequence
0307-range-sum-query-mutable
0330-patching-array
0347-top-k-frequent-elements
0406-queue-reconstruction-by-height
0435-non-overlapping-intervals
0455-assign-cookies
0457-circular-array-loop
0502-ipo
0517-super-washing-machines
0561-array-partition
0581-shortest-unsorted-continuous-subarray
0675-cut-off-trees-for-golf-event
0692-top-k-frequent-words
0695-max-area-of-island
0741-cherry-pickup
0749-contain-virus
0766-toeplitz-matrix
0794-valid-tic-tac-toe-state
0807-max-increase-to-keep-city-skyline
0832-flipping-an-image
0835-image-overlap
0840-magic-squares-in-grid
0851-loud-and-rich
0861-score-after-flipping-matrix
0885-spiral-matrix-iii
0892-surface-area-of-3d-shapes
0909-snakes-and-ladders
0914-x-of-a-kind-in-a-deck-of-cards
0923-3sum-with-multiplicity
0924-minimize-malware-spread
0931-minimum-falling-path-sum
0959-regions-cut-by-slashes
0999-available-captures-for-rook
1020-number-of-enclaves
1034-coloring-a-border
1072-flip-columns-for-maximum-number-of-equal-rows
1090-largest-values-from-labels
1091-shortest-path-in-binary-matrix
1139-largest-1-bordered-square
1162-as-far-from-land-as-possible
1219-path-with-maximum-gold
1222-queens-that-can-attack-the-king
1253-reconstruct-a-2-row-binary-matrix
1254-number-of-closed-islands
1260-shift-2d-grid
1267-count-servers-that-communicate
1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1395-count-number-of-teams
1464-maximum-product-of-two-elements-in-an-array
1620-coordinate-with-maximum-network-quality
1823-find-the-winner-of-the-circular-game
1846-maximum-element-after-decreasing-and-rearranging
1967-number-of-strings-that-appear-as-substrings-in-word
2039-the-time-when-the-network-becomes-idle
2488-count-subarrays-with-median-k
2617-minimum-number-of-visited-cells-in-a-grid
2812-find-the-safest-path-in-a-grid
2966-divide-array-into-arrays-with-max-difference
3020-find-the-maximum-number-of-elements-in-subset
3025-find-the-number-of-ways-to-place-people-i
3047-find-the-largest-area-of-square-inside-two-rectangles
3386-button-with-longest-push-time
3532-path-existence-queries-in-a-graph-i
3620-network-recovery-pathways
3737-count-subarrays-with-majority-element-i

Matrix

0675-cut-off-trees-for-golf-event
0695-max-area-of-island
0741-cherry-pickup
0749-contain-virus
0766-toeplitz-matrix
0794-valid-tic-tac-toe-state
0807-max-increase-to-keep-city-skyline
0832-flipping-an-image
0835-image-overlap
0840-magic-squares-in-grid
0861-score-after-flipping-matrix
0885-spiral-matrix-iii
0892-surface-area-of-3d-shapes
0909-snakes-and-ladders
0931-minimum-falling-path-sum
0959-regions-cut-by-slashes
0999-available-captures-for-rook
1020-number-of-enclaves
1034-coloring-a-border
1072-flip-columns-for-maximum-number-of-equal-rows
1091-shortest-path-in-binary-matrix
1139-largest-1-bordered-square
1162-as-far-from-land-as-possible
1219-path-with-maximum-gold
1222-queens-that-can-attack-the-king
1253-reconstruct-a-2-row-binary-matrix
1254-number-of-closed-islands
1260-shift-2d-grid
1267-count-servers-that-communicate
1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2617-minimum-number-of-visited-cells-in-a-grid
2812-find-the-safest-path-in-a-grid

Hash Table

0141-linked-list-cycle
0146-lru-cache
0202-happy-number
0229-majority-element-ii
0268-missing-number
0299-bulls-and-cows
0347-top-k-frequent-elements
0387-first-unique-character-in-a-string
0409-longest-palindrome
0451-sort-characters-by-frequency
0457-circular-array-loop
0460-lfu-cache
0692-top-k-frequent-words
0767-reorganize-string
0840-magic-squares-in-grid
0869-reordered-power-of-2
0914-x-of-a-kind-in-a-deck-of-cards
0923-3sum-with-multiplicity
0924-minimize-malware-spread
0959-regions-cut-by-slashes
1072-flip-columns-for-maximum-number-of-equal-rows
1090-largest-values-from-labels
2488-count-subarrays-with-median-k
3020-find-the-maximum-number-of-elements-in-subset
3272-find-the-count-of-good-integers
3532-path-existence-queries-in-a-graph-i
3737-count-subarrays-with-majority-element-i

Segment Tree

0307-range-sum-query-mutable
0406-queue-reconstruction-by-height
1395-count-number-of-teams
3737-count-subarrays-with-majority-element-i

Merge Sort

0148-sort-list
3737-count-subarrays-with-majority-element-i

Counting

0229-majority-element-ii
0299-bulls-and-cows
0347-top-k-frequent-elements
0387-first-unique-character-in-a-string
0451-sort-characters-by-frequency
0692-top-k-frequent-words
0767-reorganize-string
0869-reordered-power-of-2
0914-x-of-a-kind-in-a-deck-of-cards
0923-3sum-with-multiplicity
1090-largest-values-from-labels
1267-count-servers-that-communicate
3737-count-subarrays-with-majority-element-i

Prefix Sum

2485-find-the-pivot-integer
2488-count-subarrays-with-median-k
3737-count-subarrays-with-majority-element-i

Combinatorics

0920-number-of-music-playlists
1201-ugly-number-iii
1359-count-all-valid-pickup-and-delivery-options
3272-find-the-count-of-good-integers

Number Theory

0258-add-digits
0914-x-of-a-kind-in-a-deck-of-cards
1201-ugly-number-iii
3658-gcd-of-odd-and-even-sums

Simulation

0258-add-digits
0749-contain-virus
0832-flipping-an-image
0885-spiral-matrix-iii
0999-available-captures-for-rook
1222-queens-that-can-attack-the-king
1260-shift-2d-grid
1823-find-the-winner-of-the-circular-game

Enumeration

0869-reordered-power-of-2
1291-sequential-digits
1620-coordinate-with-maximum-network-quality
3020-find-the-maximum-number-of-elements-in-subset
3025-find-the-number-of-ways-to-place-people-i
3272-find-the-count-of-good-integers
3345-smallest-divisible-digit-product-i

Union-Find

0695-max-area-of-island
0765-couples-holding-hands
0785-is-graph-bipartite
0886-possible-bipartition
0924-minimize-malware-spread
0959-regions-cut-by-slashes
1020-number-of-enclaves
1254-number-of-closed-islands
1267-count-servers-that-communicate
2617-minimum-number-of-visited-cells-in-a-grid
2685-count-the-number-of-complete-components
2812-find-the-safest-path-in-a-grid
3532-path-existence-queries-in-a-graph-i

Two Pointers

0125-valid-palindrome
0141-linked-list-cycle
0143-reorder-list
0148-sort-list
0167-two-sum-ii-input-array-is-sorted
0202-happy-number
0283-move-zeroes
0287-find-the-duplicate-number
0344-reverse-string
0443-string-compression
0455-assign-cookies
0457-circular-array-loop
0581-shortest-unsorted-continuous-subarray
0832-flipping-an-image
0923-3sum-with-multiplicity
2486-append-characters-to-string-to-make-subsequence

Bit Manipulation

0268-missing-number
0287-find-the-duplicate-number
0832-flipping-an-image
0847-shortest-path-visiting-all-nodes
0861-score-after-flipping-matrix

Geometry

0223-rectangle-area
0892-surface-area-of-3d-shapes
3025-find-the-number-of-ways-to-place-people-i
3047-find-the-largest-area-of-square-inside-two-rectangles

Sorting

0148-sort-list
0229-majority-element-ii
0268-missing-number
0347-top-k-frequent-elements
0406-queue-reconstruction-by-height
0435-non-overlapping-intervals
0451-sort-characters-by-frequency
0455-assign-cookies
0502-ipo
0561-array-partition
0581-shortest-unsorted-continuous-subarray
0692-top-k-frequent-words
0767-reorganize-string
0869-reordered-power-of-2
0923-3sum-with-multiplicity
1090-largest-values-from-labels
1464-maximum-product-of-two-elements-in-an-array
1846-maximum-element-after-decreasing-and-rearranging
2966-divide-array-into-arrays-with-max-difference
3025-find-the-number-of-ways-to-place-people-i

Recursion

0143-reorder-list
1823-find-the-winner-of-the-circular-game
2487-remove-nodes-from-linked-list

Backtracking

1219-path-with-maximum-gold

Graph Theory

0743-network-delay-time
0753-cracking-the-safe
0765-couples-holding-hands
0785-is-graph-bipartite
0834-sum-of-distances-in-tree
0841-keys-and-rooms
0847-shortest-path-visiting-all-nodes
0851-loud-and-rich
0882-reachable-nodes-in-subdivided-graph
0886-possible-bipartition
0913-cat-and-mouse
0924-minimize-malware-spread
1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1615-maximal-network-rank
2039-the-time-when-the-network-becomes-idle
2685-count-the-number-of-complete-components
3532-path-existence-queries-in-a-graph-i
3620-network-recovery-pathways

Shortest Path

0743-network-delay-time
0882-reachable-nodes-in-subdivided-graph
1368-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
3620-network-recovery-pathways

Doubly-Linked List

0146-lru-cache
0460-lfu-cache

Topological Sort

0851-loud-and-rich
0913-cat-and-mouse
3620-network-recovery-pathways

Bucket Sort

0347-top-k-frequent-elements
0451-sort-characters-by-frequency
0692-top-k-frequent-words

Quickselect

0347-top-k-frequent-elements

Trie

0692-top-k-frequent-words

Counting Sort

0561-array-partition

Queue

0387-first-unique-character-in-a-string
1823-find-the-winner-of-the-circular-game

Eulerian Circuit

0753-cracking-the-safe

Bitmask

0847-shortest-path-visiting-all-nodes

Memoization

0913-cat-and-mouse

Game Theory

0913-cat-and-mouse

Sliding Window

1044-longest-duplicate-substring

Rolling Hash

1044-longest-duplicate-substring

Suffix Array

1044-longest-duplicate-substring

Hash Function

1044-longest-duplicate-substring

Binary Indexed Tree

0307-range-sum-query-mutable
0406-queue-reconstruction-by-height
1395-count-number-of-teams

Floyd's Cycle Finding Algorithm

0141-linked-list-cycle
0202-happy-number
0457-circular-array-loop

About

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

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages