Skip to content

garden14/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

Array

0001-two-sum
0026-remove-duplicates-from-sorted-array
0027-remove-element
0033-search-in-rotated-sorted-array
0035-search-insert-position
0036-valid-sudoku
0039-combination-sum
0046-permutations
0048-rotate-image
0049-group-anagrams
0054-spiral-matrix
0056-merge-intervals
0066-plus-one
0073-set-matrix-zeroes
0074-search-a-2d-matrix
0080-remove-duplicates-from-sorted-array-ii
0088-merge-sorted-array
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
0118-pascals-triangle
0119-pascals-triangle-ii
0120-triangle
0121-best-time-to-buy-and-sell-stock
0128-longest-consecutive-sequence
0130-surrounded-regions
0134-gas-station
0139-word-break
0150-evaluate-reverse-polish-notation
0162-find-peak-element
0169-majority-element
0189-rotate-array
0198-house-robber
0200-number-of-islands
0209-minimum-size-subarray-sum
0215-kth-largest-element-in-an-array
0219-contains-duplicate-ii
0228-summary-ranges
0268-missing-number
0274-h-index
0283-move-zeroes
0373-find-k-pairs-with-smallest-sums
0380-insert-delete-getrandom-o1
0455-assign-cookies
0506-relative-ranks
0561-array-partition
0605-can-place-flowers
0643-maximum-average-subarray-i
0735-asteroid-collision
0747-min-cost-climbing-stairs
0945-snakes-and-ladders
1528-kids-with-the-greatest-number-of-candies

Sorting

0049-group-anagrams
0056-merge-intervals
0088-merge-sorted-array
0169-majority-element
0215-kth-largest-element-in-an-array
0242-valid-anagram
0268-missing-number
0274-h-index
0455-assign-cookies
0506-relative-ranks
0561-array-partition

Heap (Priority Queue)

0215-kth-largest-element-in-an-array
0373-find-k-pairs-with-smallest-sums
0506-relative-ranks
0789-kth-largest-element-in-a-stream

Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0101-symmetric-tree
0102-binary-tree-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
0108-convert-sorted-array-to-binary-search-tree
0112-path-sum
0114-flatten-binary-tree-to-linked-list
0117-populating-next-right-pointers-in-each-node-ii
0129-sum-root-to-leaf-numbers
0199-binary-tree-right-side-view
0222-count-complete-tree-nodes
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0530-minimum-absolute-difference-in-bst
0637-average-of-levels-in-binary-tree
0783-search-in-a-binary-search-tree
0789-kth-largest-element-in-a-stream
0904-leaf-similar-trees
0933-increasing-order-search-tree

Design

0155-min-stack
0380-insert-delete-getrandom-o1
0789-kth-largest-element-in-a-stream
0969-number-of-recent-calls

Binary Search Tree

0033-search-in-rotated-sorted-array
0035-search-insert-position
0069-sqrtx
0074-search-a-2d-matrix
0098-validate-binary-search-tree
0108-convert-sorted-array-to-binary-search-tree
0162-find-peak-element
0209-minimum-size-subarray-sum
0222-count-complete-tree-nodes
0230-kth-smallest-element-in-a-bst
0268-missing-number
0441-arranging-coins
0530-minimum-absolute-difference-in-bst
0783-search-in-a-binary-search-tree
0789-kth-largest-element-in-a-stream
0933-increasing-order-search-tree

Binary Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0101-symmetric-tree
0102-binary-tree-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
0108-convert-sorted-array-to-binary-search-tree
0112-path-sum
0114-flatten-binary-tree-to-linked-list
0117-populating-next-right-pointers-in-each-node-ii
0129-sum-root-to-leaf-numbers
0199-binary-tree-right-side-view
0222-count-complete-tree-nodes
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0530-minimum-absolute-difference-in-bst
0637-average-of-levels-in-binary-tree
0783-search-in-a-binary-search-tree
0789-kth-largest-element-in-a-stream
0904-leaf-similar-trees
0933-increasing-order-search-tree

Data Stream

0789-kth-largest-element-in-a-stream
0969-number-of-recent-calls

Depth-First Search

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0112-path-sum
0114-flatten-binary-tree-to-linked-list
0117-populating-next-right-pointers-in-each-node-ii
0129-sum-root-to-leaf-numbers
0130-surrounded-regions
0133-clone-graph
0199-binary-tree-right-side-view
0200-number-of-islands
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0530-minimum-absolute-difference-in-bst
0637-average-of-levels-in-binary-tree
0904-leaf-similar-trees
0933-increasing-order-search-tree
2121-find-if-path-exists-in-graph

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0112-path-sum
0117-populating-next-right-pointers-in-each-node-ii
0130-surrounded-regions
0133-clone-graph
0199-binary-tree-right-side-view
0200-number-of-islands
0226-invert-binary-tree
0530-minimum-absolute-difference-in-bst
0637-average-of-levels-in-binary-tree
0945-snakes-and-ladders
2121-find-if-path-exists-in-graph

Stack

0020-valid-parentheses
0071-simplify-path
0094-binary-tree-inorder-traversal
0114-flatten-binary-tree-to-linked-list
0150-evaluate-reverse-polish-notation
0155-min-stack
0735-asteroid-collision
0933-increasing-order-search-tree
2470-removing-stars-from-a-string

Dynamic Programming

0070-climbing-stairs
0118-pascals-triangle
0119-pascals-triangle-ii
0120-triangle
0121-best-time-to-buy-and-sell-stock
0139-word-break
0198-house-robber
0392-is-subsequence
0747-min-cost-climbing-stairs
1236-n-th-tribonacci-number

Greedy

0134-gas-station
0409-longest-palindrome
0455-assign-cookies
0561-array-partition
0605-can-place-flowers

Counting Sort

0169-majority-element
0274-h-index
0383-ransom-note
0561-array-partition

Graph

0133-clone-graph
1916-find-center-of-star-graph
2121-find-if-path-exists-in-graph

Union Find

0128-longest-consecutive-sequence
0130-surrounded-regions
0200-number-of-islands
2121-find-if-path-exists-in-graph

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0012-integer-to-roman
0013-roman-to-integer
0017-letter-combinations-of-a-phone-number
0036-valid-sudoku
0049-group-anagrams
0073-set-matrix-zeroes
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0128-longest-consecutive-sequence
0133-clone-graph
0138-copy-list-with-random-pointer
0139-word-break
0141-linked-list-cycle
0169-majority-element
0202-happy-number
0205-isomorphic-strings
0219-contains-duplicate-ii
0242-valid-anagram
0268-missing-number
0290-word-pattern
0380-insert-delete-getrandom-o1
0383-ransom-note
0409-longest-palindrome

Math

0002-add-two-numbers
0009-palindrome-number
0012-integer-to-roman
0013-roman-to-integer
0048-rotate-image
0066-plus-one
0067-add-binary
0069-sqrtx
0070-climbing-stairs
0150-evaluate-reverse-polish-notation
0172-factorial-trailing-zeroes
0189-rotate-array
0202-happy-number
0268-missing-number
0380-insert-delete-getrandom-o1
0441-arranging-coins
1146-greatest-common-divisor-of-strings
1236-n-th-tribonacci-number

Bit Manipulation

0067-add-binary
0190-reverse-bits
0222-count-complete-tree-nodes
0268-missing-number

String

0003-longest-substring-without-repeating-characters
0006-zigzag-conversion
0012-integer-to-roman
0013-roman-to-integer
0014-longest-common-prefix
0017-letter-combinations-of-a-phone-number
0020-valid-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0049-group-anagrams
0058-length-of-last-word
0067-add-binary
0071-simplify-path
0125-valid-palindrome
0139-word-break
0151-reverse-words-in-a-string
0205-isomorphic-strings
0242-valid-anagram
0290-word-pattern
0345-reverse-vowels-of-a-string
0383-ransom-note
0392-is-subsequence
0409-longest-palindrome
1146-greatest-common-divisor-of-strings
1894-merge-strings-alternately
2470-removing-stars-from-a-string

Two Pointers

0026-remove-duplicates-from-sorted-array
0027-remove-element
0028-find-the-index-of-the-first-occurrence-in-a-string
0080-remove-duplicates-from-sorted-array-ii
0088-merge-sorted-array
0125-valid-palindrome
0141-linked-list-cycle
0151-reverse-words-in-a-string
0189-rotate-array
0202-happy-number
0283-move-zeroes
0345-reverse-vowels-of-a-string
0392-is-subsequence
0455-assign-cookies
1894-merge-strings-alternately

Memoization

0070-climbing-stairs
0139-word-break
1236-n-th-tribonacci-number

Database

0175-combine-two-tables
0176-second-highest-salary
0177-nth-highest-salary
0178-rank-scores
0181-employees-earning-more-than-their-managers

Simulation

0054-spiral-matrix
0067-add-binary
0735-asteroid-collision
2470-removing-stars-from-a-string

Trie

0014-longest-common-prefix
0139-word-break

Queue

0969-number-of-recent-calls

Sliding Window

0003-longest-substring-without-repeating-characters
0209-minimum-size-subarray-sum
0219-contains-duplicate-ii
0643-maximum-average-subarray-i

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string

Linked List

0002-add-two-numbers
0021-merge-two-sorted-lists
0092-reverse-linked-list-ii
0114-flatten-binary-tree-to-linked-list
0117-populating-next-right-pointers-in-each-node-ii
0138-copy-list-with-random-pointer
0141-linked-list-cycle

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists

Matrix

0036-valid-sudoku
0048-rotate-image
0054-spiral-matrix
0073-set-matrix-zeroes
0074-search-a-2d-matrix
0130-surrounded-regions
0200-number-of-islands
0945-snakes-and-ladders

Prefix Sum

0209-minimum-size-subarray-sum

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
0169-majority-element
0190-reverse-bits
0215-kth-largest-element-in-an-array

Randomized

0380-insert-delete-getrandom-o1

Backtracking

0017-letter-combinations-of-a-phone-number
0039-combination-sum
0046-permutations
0077-combinations

Quickselect

0215-kth-largest-element-in-an-array

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

No releases published

Packages

No packages published