Skip to content

zapjur/LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

LeetCode Topics

Array

0078-subsets
0198-house-robber
0215-kth-largest-element-in-an-array
0287-find-the-duplicate-number
0414-third-maximum-number
0494-target-sum
0632-smallest-range-covering-elements-from-k-lists
0739-daily-temperatures
0780-max-chunks-to-make-sorted
0787-sliding-puzzle
0892-shortest-subarray-with-sum-at-least-k
1002-maximum-width-ramp
1014-k-closest-points-to-origin
1127-last-stone-weight
1147-flip-columns-for-maximum-number-of-equal-rows
1256-rank-transform-of-an-array
1350-remove-sub-folders-from-the-filesystem
1402-count-square-submatrices-with-all-ones
1468-check-if-n-and-its-double-exist
1570-final-prices-with-a-special-discount-in-a-shop
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1694-make-sum-divisible-by-p
1755-defuse-the-bomb
1766-minimum-number-of-removals-to-make-mountain-array
1886-minimum-limit-of-balls-in-a-bag
1923-sentence-similarity-iii
1940-maximum-xor-for-each-query
1972-rotating-the-box
2054-the-number-of-the-smallest-unoccupied-chair
2089-maximum-matrix-sum
2164-two-best-non-overlapping-events
2170-count-number-of-maximum-bitwise-or-subsets
2179-most-beautiful-item-for-each-query
2188-minimized-maximum-of-products-distributed-to-any-store
2232-adding-spaces-to-a-string
2343-count-unguarded-cells-in-the-grid
2356-largest-combination-with-bitwise-and-greater-than-zero
2375-minimum-obstacle-removal-to-reach-corner
2488-divide-intervals-into-minimum-number-of-groups
2545-height-of-binary-tree-after-subtree-removal-queries
2552-maximum-sum-of-distinct-subarrays-with-length-k
2554-minimum-total-distance-traveled
2586-longest-square-streak-in-an-array
2616-maximal-score-after-applying-k-operations
2640-maximum-number-of-integers-to-choose-from-a-range-i
2699-count-the-number-of-fair-pairs
2711-minimum-time-to-visit-a-cell-in-a-grid
2716-prime-subtraction-operation
2794-maximum-number-of-moves-in-a-grid
3291-find-if-array-can-be-sorted
3380-shortest-subarray-with-or-at-least-k-ii
3427-special-array-ii
3517-shortest-distance-after-road-addition-queries-i
3522-find-the-power-of-k-size-subarrays-i
3555-final-array-state-after-k-multiplication-operations-i

Hash Table

0138-copy-list-with-random-pointer
0141-linked-list-cycle
0387-first-unique-character-in-a-string
0567-permutation-in-string
0632-smallest-range-covering-elements-from-k-lists
1147-flip-columns-for-maximum-number-of-equal-rows
1256-rank-transform-of-an-array
1468-check-if-n-and-its-double-exist
1694-make-sum-divisible-by-p
1715-split-a-string-into-the-max-number-of-unique-substrings
2054-the-number-of-the-smallest-unoccupied-chair
2300-construct-string-with-repeat-limit
2356-largest-combination-with-bitwise-and-greater-than-zero
2552-maximum-sum-of-distinct-subarrays-with-length-k
2586-longest-square-streak-in-an-array
2599-take-k-of-each-character-from-left-and-right
2640-maximum-number-of-integers-to-choose-from-a-range-i
2677-cousins-in-binary-tree-ii
3267-find-longest-special-substring-that-occurs-thrice-i

Sorting

0215-kth-largest-element-in-an-array
0414-third-maximum-number
0632-smallest-range-covering-elements-from-k-lists
0780-max-chunks-to-make-sorted
1014-k-closest-points-to-origin
1256-rank-transform-of-an-array
1468-check-if-n-and-its-double-exist
2164-two-best-non-overlapping-events
2179-most-beautiful-item-for-each-query
2488-divide-intervals-into-minimum-number-of-groups
2554-minimum-total-distance-traveled
2586-longest-square-streak-in-an-array
2640-maximum-number-of-integers-to-choose-from-a-range-i
2646-kth-largest-sum-in-a-binary-tree
2699-count-the-number-of-fair-pairs
3291-find-if-array-can-be-sorted

Database

0181-employees-earning-more-than-their-managers

String

0032-longest-valid-parentheses
0387-first-unique-character-in-a-string
0412-fizz-buzz
0567-permutation-in-string
0812-rotate-string
0957-minimum-add-to-make-parentheses-valid
1197-parsing-a-boolean-expression
1302-delete-characters-to-make-fancy-string
1304-longest-happy-string
1350-remove-sub-folders-from-the-filesystem
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1667-find-kth-bit-in-nth-binary-string
1715-split-a-string-into-the-max-number-of-unique-substrings
1894-merge-strings-alternately
1923-sentence-similarity-iii
2095-minimum-number-of-swaps-to-make-the-string-balanced
2232-adding-spaces-to-a-string
2300-construct-string-with-repeat-limit
2414-move-pieces-to-obtain-a-string
2580-circular-sentence
2599-take-k-of-each-character-from-left-and-right
2800-minimum-string-length-after-removing-substrings
3018-make-string-a-subsequence-using-cyclic-increments
3174-minimum-number-of-changes-to-make-binary-string-beautiful
3195-separate-black-and-white-balls
3267-find-longest-special-substring-that-occurs-thrice-i
3451-string-compression-iii

Queue

0387-first-unique-character-in-a-string
0892-shortest-subarray-with-sum-at-least-k

Counting

0387-first-unique-character-in-a-string
2300-construct-string-with-repeat-limit
2356-largest-combination-with-bitwise-and-greater-than-zero
3267-find-longest-special-substring-that-occurs-thrice-i

Math

0002-add-two-numbers
0070-climbing-stairs
0412-fizz-buzz
0670-maximum-swap
1014-k-closest-points-to-origin
2716-prime-subtraction-operation
3555-final-array-state-after-k-multiplication-operations-i

Simulation

0412-fizz-buzz
1667-find-kth-bit-in-nth-binary-string
2232-adding-spaces-to-a-string
2299-merge-nodes-in-between-zeros
2343-count-unguarded-cells-in-the-grid
2800-minimum-string-length-after-removing-substrings
3555-final-array-state-after-k-multiplication-operations-i

Stack

0032-longest-valid-parentheses
0143-reorder-list
0739-daily-temperatures
0780-max-chunks-to-make-sorted
0957-minimum-add-to-make-parentheses-valid
1002-maximum-width-ramp
1197-parsing-a-boolean-expression
1570-final-prices-with-a-special-discount-in-a-shop
1679-shortest-subarray-to-be-removed-to-make-array-sorted
2095-minimum-number-of-swaps-to-make-the-string-balanced
2800-minimum-string-length-after-removing-substrings

Monotonic Stack

0739-daily-temperatures
0780-max-chunks-to-make-sorted
1002-maximum-width-ramp
1570-final-prices-with-a-special-discount-in-a-shop
1679-shortest-subarray-to-be-removed-to-make-array-sorted

Prefix Sum

0892-shortest-subarray-with-sum-at-least-k
1694-make-sum-divisible-by-p
1940-maximum-xor-for-each-query
2488-divide-intervals-into-minimum-number-of-groups
3427-special-array-ii

Linked List

0002-add-two-numbers
0019-remove-nth-node-from-end-of-list
0023-merge-k-sorted-lists
0138-copy-list-with-random-pointer
0141-linked-list-cycle
0143-reorder-list
2299-merge-nodes-in-between-zeros

Two Pointers

0019-remove-nth-node-from-end-of-list
0141-linked-list-cycle
0143-reorder-list
0287-find-the-duplicate-number
0567-permutation-in-string
1468-check-if-n-and-its-double-exist
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1894-merge-strings-alternately
1923-sentence-similarity-iii
1972-rotating-the-box
2095-minimum-number-of-swaps-to-make-the-string-balanced
2232-adding-spaces-to-a-string
2414-move-pieces-to-obtain-a-string
2488-divide-intervals-into-minimum-number-of-groups
2699-count-the-number-of-fair-pairs
3018-make-string-a-subsequence-using-cyclic-increments
3195-separate-black-and-white-balls

Recursion

0002-add-two-numbers
0143-reorder-list
1197-parsing-a-boolean-expression
1667-find-kth-bit-in-nth-binary-string

Sliding Window

0567-permutation-in-string
0632-smallest-range-covering-elements-from-k-lists
0892-shortest-subarray-with-sum-at-least-k
1755-defuse-the-bomb
2552-maximum-sum-of-distinct-subarrays-with-length-k
2599-take-k-of-each-character-from-left-and-right
3267-find-longest-special-substring-that-occurs-thrice-i
3380-shortest-subarray-with-or-at-least-k-ii
3522-find-the-power-of-k-size-subarrays-i

Binary Search

0287-find-the-duplicate-number
0892-shortest-subarray-with-sum-at-least-k
1468-check-if-n-and-its-double-exist
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1766-minimum-number-of-removals-to-make-mountain-array
1886-minimum-limit-of-balls-in-a-bag
2164-two-best-non-overlapping-events
2179-most-beautiful-item-for-each-query
2188-minimized-maximum-of-products-distributed-to-any-store
2586-longest-square-streak-in-an-array
2640-maximum-number-of-integers-to-choose-from-a-range-i
2699-count-the-number-of-fair-pairs
2716-prime-subtraction-operation
3267-find-longest-special-substring-that-occurs-thrice-i
3427-special-array-ii

Bit Manipulation

0078-subsets
0287-find-the-duplicate-number
1940-maximum-xor-for-each-query
2170-count-number-of-maximum-bitwise-or-subsets
2356-largest-combination-with-bitwise-and-greater-than-zero
3291-find-if-array-can-be-sorted
3380-shortest-subarray-with-or-at-least-k-ii
3394-minimum-array-end

Greedy

0632-smallest-range-covering-elements-from-k-lists
0670-maximum-swap
0780-max-chunks-to-make-sorted
0957-minimum-add-to-make-parentheses-valid
1304-longest-happy-string
1766-minimum-number-of-removals-to-make-mountain-array
2089-maximum-matrix-sum
2095-minimum-number-of-swaps-to-make-the-string-balanced
2300-construct-string-with-repeat-limit
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
2640-maximum-number-of-integers-to-choose-from-a-range-i
2716-prime-subtraction-operation
3195-separate-black-and-white-balls

Dynamic Programming

0032-longest-valid-parentheses
0070-climbing-stairs
0198-house-robber
0494-target-sum
1402-count-square-submatrices-with-all-ones
1766-minimum-number-of-removals-to-make-mountain-array
2164-two-best-non-overlapping-events
2554-minimum-total-distance-traveled
2586-longest-square-streak-in-an-array
2794-maximum-number-of-moves-in-a-grid

Divide and Conquer

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array
1014-k-closest-points-to-origin

Heap (Priority Queue)

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array
0632-smallest-range-covering-elements-from-k-lists
0789-kth-largest-element-in-a-stream
0892-shortest-subarray-with-sum-at-least-k
1014-k-closest-points-to-origin
1127-last-stone-weight
1304-longest-happy-string
2054-the-number-of-the-smallest-unoccupied-chair
2164-two-best-non-overlapping-events
2300-construct-string-with-repeat-limit
2375-minimum-obstacle-removal-to-reach-corner
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
2711-minimum-time-to-visit-a-cell-in-a-grid
3555-final-array-state-after-k-multiplication-operations-i

Merge Sort

0023-merge-k-sorted-lists

Tree

0100-same-tree
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0226-invert-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
0789-kth-largest-element-in-a-stream
0988-flip-equivalent-binary-trees
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Depth-First Search

0100-same-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0226-invert-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
0988-flip-equivalent-binary-trees
1350-remove-sub-folders-from-the-filesystem
2201-valid-arrangement-of-pairs
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2677-cousins-in-binary-tree-ii

Breadth-First Search

0100-same-tree
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0226-invert-binary-tree
0787-sliding-puzzle
2375-minimum-obstacle-removal-to-reach-corner
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii
2711-minimum-time-to-visit-a-cell-in-a-grid
3517-shortest-distance-after-road-addition-queries-i

Binary Tree

0100-same-tree
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0226-invert-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
0789-kth-largest-element-in-a-stream
0988-flip-equivalent-binary-trees
2493-reverse-odd-levels-of-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

String Matching

0572-subtree-of-another-tree
0812-rotate-string
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence

Hash Function

0572-subtree-of-another-tree

Design

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

Binary Search Tree

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

Data Stream

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

Geometry

1014-k-closest-points-to-origin

Quickselect

0215-kth-largest-element-in-an-array
1014-k-closest-points-to-origin

Backtracking

0078-subsets
0494-target-sum
1715-split-a-string-into-the-max-number-of-unique-substrings
2170-count-number-of-maximum-bitwise-or-subsets

Memoization

0070-climbing-stairs

Enumeration

2170-count-number-of-maximum-bitwise-or-subsets

Trie

1350-remove-sub-folders-from-the-filesystem

Matrix

0787-sliding-puzzle
1147-flip-columns-for-maximum-number-of-equal-rows
1402-count-square-submatrices-with-all-ones
1972-rotating-the-box
2089-maximum-matrix-sum
2343-count-unguarded-cells-in-the-grid
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
2794-maximum-number-of-moves-in-a-grid

Number Theory

2716-prime-subtraction-operation

Monotonic Queue

0892-shortest-subarray-with-sum-at-least-k

Graph

2201-valid-arrangement-of-pairs
2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid
3189-find-champion-ii
3517-shortest-distance-after-road-addition-queries-i

Shortest Path

2375-minimum-obstacle-removal-to-reach-corner
2711-minimum-time-to-visit-a-cell-in-a-grid

Eulerian Circuit

2201-valid-arrangement-of-pairs

About

Problems from LeetCode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published