Skip to content

bhartik021/LeetHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

904 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetHub

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

LeetCode Topics

String

0003-longest-substring-without-repeating-characters
0012-integer-to-roman
0013-roman-to-integer
0020-valid-parentheses
0022-generate-parentheses
0049-group-anagrams
0058-length-of-last-word
0067-add-binary
0076-minimum-window-substring
0125-valid-palindrome
0242-valid-anagram
0257-binary-tree-paths
0297-serialize-and-deserialize-binary-tree
0383-ransom-note
0387-first-unique-character-in-a-string
0424-longest-repeating-character-replacement
0438-find-all-anagrams-in-a-string
0449-serialize-and-deserialize-bst
0451-sort-characters-by-frequency
0567-permutation-in-string
0606-construct-string-from-binary-tree
0657-robot-return-to-origin
0680-valid-palindrome-ii
0692-top-k-frequent-words
0709-to-lower-case
0771-jewels-and-stones
0988-smallest-string-starting-from-leaf
1456-maximum-number-of-vowels-in-a-substring-of-given-length
2833-furthest-point-from-origin

Backtracking

0022-generate-parentheses
0089-gray-code
0113-path-sum-ii
0257-binary-tree-paths
0988-smallest-string-starting-from-leaf

Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0107-binary-tree-level-order-traversal-ii
0108-convert-sorted-array-to-binary-search-tree
0109-convert-sorted-list-to-binary-search-tree
0113-path-sum-ii
0116-populating-next-right-pointers-in-each-node
0117-populating-next-right-pointers-in-each-node-ii
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0257-binary-tree-paths
0297-serialize-and-deserialize-binary-tree
0449-serialize-and-deserialize-bst
0450-delete-node-in-a-bst
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0538-convert-bst-to-greater-tree
0543-diameter-of-binary-tree
0589-n-ary-tree-preorder-traversal
0590-n-ary-tree-postorder-traversal
0606-construct-string-from-binary-tree
0637-average-of-levels-in-binary-tree
0653-two-sum-iv-input-is-a-bst
0700-search-in-a-binary-search-tree
0701-insert-into-a-binary-search-tree
0872-leaf-similar-trees
0889-construct-binary-tree-from-preorder-and-postorder-traversal
0987-vertical-order-traversal-of-a-binary-tree
0988-smallest-string-starting-from-leaf
1038-binary-search-tree-to-greater-sum-tree
1161-maximum-level-sum-of-a-binary-tree

Depth-First Search

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0104-maximum-depth-of-binary-tree
0113-path-sum-ii
0116-populating-next-right-pointers-in-each-node
0117-populating-next-right-pointers-in-each-node-ii
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0257-binary-tree-paths
0297-serialize-and-deserialize-binary-tree
0449-serialize-and-deserialize-bst
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0538-convert-bst-to-greater-tree
0543-diameter-of-binary-tree
0589-n-ary-tree-preorder-traversal
0590-n-ary-tree-postorder-traversal
0606-construct-string-from-binary-tree
0637-average-of-levels-in-binary-tree
0653-two-sum-iv-input-is-a-bst
0872-leaf-similar-trees
0987-vertical-order-traversal-of-a-binary-tree
0988-smallest-string-starting-from-leaf
1038-binary-search-tree-to-greater-sum-tree
1161-maximum-level-sum-of-a-binary-tree

Binary Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0107-binary-tree-level-order-traversal-ii
0108-convert-sorted-array-to-binary-search-tree
0109-convert-sorted-list-to-binary-search-tree
0113-path-sum-ii
0116-populating-next-right-pointers-in-each-node
0117-populating-next-right-pointers-in-each-node-ii
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0257-binary-tree-paths
0297-serialize-and-deserialize-binary-tree
0449-serialize-and-deserialize-bst
0450-delete-node-in-a-bst
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0538-convert-bst-to-greater-tree
0543-diameter-of-binary-tree
0606-construct-string-from-binary-tree
0637-average-of-levels-in-binary-tree
0653-two-sum-iv-input-is-a-bst
0700-search-in-a-binary-search-tree
0701-insert-into-a-binary-search-tree
0872-leaf-similar-trees
0889-construct-binary-tree-from-preorder-and-postorder-traversal
0987-vertical-order-traversal-of-a-binary-tree
0988-smallest-string-starting-from-leaf
1038-binary-search-tree-to-greater-sum-tree
1161-maximum-level-sum-of-a-binary-tree

Array

0001-two-sum
0011-container-with-most-water
0015-3sum
0026-remove-duplicates-from-sorted-array
0027-remove-element
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0042-trapping-rain-water
0049-group-anagrams
0066-plus-one
0075-sort-colors
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0128-longest-consecutive-sequence
0136-single-number
0137-single-number-ii
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0169-majority-element
0209-minimum-size-subarray-sum
0217-contains-duplicate
0219-contains-duplicate-ii
0260-single-number-iii
0268-missing-number
0283-move-zeroes
0347-top-k-frequent-elements
0349-intersection-of-two-arrays
0380-insert-delete-getrandom-o1
0414-third-maximum-number
0455-assign-cookies
0485-max-consecutive-ones
0540-single-element-in-a-sorted-array
0560-subarray-sum-equals-k
0643-maximum-average-subarray-i
0692-top-k-frequent-words
0697-degree-of-an-array
0704-binary-search
0889-construct-binary-tree-from-preorder-and-postorder-traversal
0904-fruit-into-baskets
0930-binary-subarrays-with-sum
0961-n-repeated-element-in-size-2n-array
0974-subarray-sums-divisible-by-k
0977-squares-of-a-sorted-array
0994-rotting-oranges
1004-max-consecutive-ones-iii
1248-count-number-of-nice-subarrays
1351-count-negative-numbers-in-a-sorted-matrix
1497-check-if-array-pairs-are-divisible-by-k
1672-richest-customer-wealth
1679-max-number-of-k-sum-pairs
1920-build-array-from-permutation
2089-find-target-indices-after-sorting-array
2183-count-array-pairs-divisible-by-k
3300-minimum-element-after-replacement-with-digit-sum
3379-transformed-array
3637-trionic-array-i

Binary Search

0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0069-sqrtx
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0209-minimum-size-subarray-sum
0268-missing-number
0349-intersection-of-two-arrays
0540-single-element-in-a-sorted-array
0704-binary-search
1004-max-consecutive-ones-iii
1351-count-negative-numbers-in-a-sorted-matrix
2089-find-target-indices-after-sorting-array

Matrix

0994-rotting-oranges
1351-count-negative-numbers-in-a-sorted-matrix
1672-richest-customer-wealth

Breadth-First Search

0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0107-binary-tree-level-order-traversal-ii
0116-populating-next-right-pointers-in-each-node
0117-populating-next-right-pointers-in-each-node-ii
0199-binary-tree-right-side-view
0297-serialize-and-deserialize-binary-tree
0449-serialize-and-deserialize-bst
0513-find-bottom-left-tree-value
0515-find-largest-value-in-each-tree-row
0637-average-of-levels-in-binary-tree
0653-two-sum-iv-input-is-a-bst
0987-vertical-order-traversal-of-a-binary-tree
0994-rotting-oranges
1161-maximum-level-sum-of-a-binary-tree

Math

0012-integer-to-roman
0013-roman-to-integer
0050-powx-n
0066-plus-one
0067-add-binary
0069-sqrtx
0089-gray-code
0202-happy-number
0231-power-of-two
0268-missing-number
0326-power-of-three
0342-power-of-four
0380-insert-delete-getrandom-o1
1248-count-number-of-nice-subarrays
2183-count-array-pairs-divisible-by-k
3300-minimum-element-after-replacement-with-digit-sum
3783-mirror-distance-of-an-integer

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0012-integer-to-roman
0013-roman-to-integer
0049-group-anagrams
0076-minimum-window-substring
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0128-longest-consecutive-sequence
0141-linked-list-cycle
0142-linked-list-cycle-ii
0146-lru-cache
0169-majority-element
0202-happy-number
0217-contains-duplicate
0219-contains-duplicate-ii
0242-valid-anagram
0268-missing-number
0347-top-k-frequent-elements
0349-intersection-of-two-arrays
0380-insert-delete-getrandom-o1
0383-ransom-note
0387-first-unique-character-in-a-string
0424-longest-repeating-character-replacement
0438-find-all-anagrams-in-a-string
0451-sort-characters-by-frequency
0560-subarray-sum-equals-k
0567-permutation-in-string
0653-two-sum-iv-input-is-a-bst
0692-top-k-frequent-words
0697-degree-of-an-array
0771-jewels-and-stones
0889-construct-binary-tree-from-preorder-and-postorder-traversal
0904-fruit-into-baskets
0930-binary-subarrays-with-sum
0961-n-repeated-element-in-size-2n-array
0974-subarray-sums-divisible-by-k
0987-vertical-order-traversal-of-a-binary-tree
1248-count-number-of-nice-subarrays
1497-check-if-array-pairs-are-divisible-by-k
1679-max-number-of-k-sum-pairs
2183-count-array-pairs-divisible-by-k

Stack

0020-valid-parentheses
0042-trapping-rain-water
0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0589-n-ary-tree-preorder-traversal
0590-n-ary-tree-postorder-traversal

Linked List

0021-merge-two-sorted-lists
0109-convert-sorted-list-to-binary-search-tree
0116-populating-next-right-pointers-in-each-node
0117-populating-next-right-pointers-in-each-node-ii
0141-linked-list-cycle
0142-linked-list-cycle-ii
0146-lru-cache
0206-reverse-linked-list
0876-middle-of-the-linked-list

Binary Search Tree

0098-validate-binary-search-tree
0108-convert-sorted-array-to-binary-search-tree
0109-convert-sorted-list-to-binary-search-tree
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0449-serialize-and-deserialize-bst
0450-delete-node-in-a-bst
0538-convert-bst-to-greater-tree
0653-two-sum-iv-input-is-a-bst
0700-search-in-a-binary-search-tree
0701-insert-into-a-binary-search-tree
1038-binary-search-tree-to-greater-sum-tree

Two Pointers

0011-container-with-most-water
0015-3sum
0026-remove-duplicates-from-sorted-array
0027-remove-element
0042-trapping-rain-water
0075-sort-colors
0125-valid-palindrome
0141-linked-list-cycle
0142-linked-list-cycle-ii
0167-two-sum-ii-input-array-is-sorted
0202-happy-number
0283-move-zeroes
0349-intersection-of-two-arrays
0455-assign-cookies
0567-permutation-in-string
0653-two-sum-iv-input-is-a-bst
0680-valid-palindrome-ii
0876-middle-of-the-linked-list
0977-squares-of-a-sorted-array
1679-max-number-of-k-sum-pairs

Divide and Conquer

0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0109-convert-sorted-list-to-binary-search-tree
0169-majority-element
0190-reverse-bits
0191-number-of-1-bits
0347-top-k-frequent-elements
0889-construct-binary-tree-from-preorder-and-postorder-traversal

Design

0146-lru-cache
0297-serialize-and-deserialize-binary-tree
0380-insert-delete-getrandom-o1
0449-serialize-and-deserialize-bst

Sorting

0015-3sum
0049-group-anagrams
0075-sort-colors
0169-majority-element
0217-contains-duplicate
0242-valid-anagram
0268-missing-number
0347-top-k-frequent-elements
0349-intersection-of-two-arrays
0414-third-maximum-number
0451-sort-characters-by-frequency
0455-assign-cookies
0692-top-k-frequent-words
0977-squares-of-a-sorted-array
0987-vertical-order-traversal-of-a-binary-tree
1679-max-number-of-k-sum-pairs
2089-find-target-indices-after-sorting-array

Counting

0169-majority-element
0347-top-k-frequent-elements
0383-ransom-note
0387-first-unique-character-in-a-string
0451-sort-characters-by-frequency
0692-top-k-frequent-words
1497-check-if-array-pairs-are-divisible-by-k
2183-count-array-pairs-divisible-by-k
2833-furthest-point-from-origin

Queue

0387-first-unique-character-in-a-string

Prefix Sum

0209-minimum-size-subarray-sum
0560-subarray-sum-equals-k
0930-binary-subarrays-with-sum
0974-subarray-sums-divisible-by-k
1004-max-consecutive-ones-iii
1248-count-number-of-nice-subarrays

Sliding Window

0003-longest-substring-without-repeating-characters
0076-minimum-window-substring
0209-minimum-size-subarray-sum
0219-contains-duplicate-ii
0424-longest-repeating-character-replacement
0438-find-all-anagrams-in-a-string
0567-permutation-in-string
0643-maximum-average-subarray-i
0904-fruit-into-baskets
0930-binary-subarrays-with-sum
1004-max-consecutive-ones-iii
1248-count-number-of-nice-subarrays
1456-maximum-number-of-vowels-in-a-substring-of-given-length

Bit Manipulation

0067-add-binary
0089-gray-code
0136-single-number
0137-single-number-ii
0190-reverse-bits
0191-number-of-1-bits
0231-power-of-two
0260-single-number-iii
0268-missing-number
0338-counting-bits
0342-power-of-four

Simulation

0067-add-binary
0657-robot-return-to-origin
1920-build-array-from-permutation
3379-transformed-array

Recursion

0021-merge-two-sorted-lists
0050-powx-n
0206-reverse-linked-list
0231-power-of-two
0326-power-of-three
0342-power-of-four

Union-Find

0128-longest-consecutive-sequence

Heap (Priority Queue)

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

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

Number Theory

2183-count-array-pairs-divisible-by-k

Doubly-Linked List

0146-lru-cache

Randomized

0380-insert-delete-getrandom-o1

Greedy

0011-container-with-most-water
0455-assign-cookies
0680-valid-palindrome-ii

Dynamic Programming

0022-generate-parentheses
0042-trapping-rain-water
0338-counting-bits

Monotonic Stack

0042-trapping-rain-water

About

A 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

Packages

Contributors

Languages