Skip to content

Latest commit

 

History

438 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data-Structures-And-Algorithms

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

LeetCode Topics

Array

0014-longest-common-prefix
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0039-combination-sum
0042-trapping-rain-water
0078-subsets
0081-search-in-rotated-sorted-array-ii
0084-largest-rectangle-in-histogram
0137-single-number-ii
0153-find-minimum-in-rotated-sorted-array
0204-count-primes
0260-single-number-iii
0496-next-greater-element-i
0503-next-greater-element-ii
0628-maximum-product-of-three-numbers
0704-binary-search
0735-asteroid-collision
0904-fruit-into-baskets
0907-sum-of-subarray-minimums
1004-max-consecutive-ones-iii
1260-shift-2d-grid
1351-count-negative-numbers-in-a-sorted-matrix
1423-maximum-points-you-can-obtain-from-cards
1464-maximum-product-of-two-elements-in-an-array
1475-final-prices-with-a-special-discount-in-a-shop
1684-count-the-number-of-consistent-strings
1720-decode-xored-array
1769-minimum-number-of-operations-to-move-all-balls-to-each-box
1846-maximum-element-after-decreasing-and-rearranging
1863-sum-of-all-subset-xor-totals
1979-find-greatest-common-divisor-of-array
2044-count-number-of-maximum-bitwise-or-subsets
2104-sum-of-subarray-ranges
2125-number-of-laser-beams-in-a-bank
2433-find-the-original-array-of-prefix-xor
2657-find-the-prefix-common-array-of-two-arrays
2859-sum-of-values-at-indices-with-k-set-bits
2942-find-words-containing-character
3514-number-of-unique-xor-triplets-ii
3838-weighted-word-mapping
3867-sum-of-gcd-of-formed-pairs

Binary Search

0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0081-search-in-rotated-sorted-array-ii
0153-find-minimum-in-rotated-sorted-array
0704-binary-search
1004-max-consecutive-ones-iii
1351-count-negative-numbers-in-a-sorted-matrix

Matrix

1260-shift-2d-grid
1351-count-negative-numbers-in-a-sorted-matrix
2125-number-of-laser-beams-in-a-bank

Greedy

0402-remove-k-digits
1689-partitioning-into-minimum-number-of-deci-binary-numbers
1846-maximum-element-after-decreasing-and-rearranging
1903-largest-odd-number-in-string
3014-minimum-number-of-pushes-to-type-word-i
3016-minimum-number-of-pushes-to-type-word-ii

Sorting

0451-sort-characters-by-frequency
0628-maximum-product-of-three-numbers
0987-vertical-order-traversal-of-a-binary-tree
1464-maximum-product-of-two-elements-in-an-array
1846-maximum-element-after-decreasing-and-rearranging
3016-minimum-number-of-pushes-to-type-word-ii
3517-smallest-palindromic-rearrangement-i
3536-maximum-product-of-two-digits
3867-sum-of-gcd-of-formed-pairs

Hash Table

0003-longest-substring-without-repeating-characters
0013-roman-to-integer
0205-isomorphic-strings
0451-sort-characters-by-frequency
0496-next-greater-element-i
0535-encode-and-decode-tinyurl
0771-jewels-and-stones
0863-all-nodes-distance-k-in-binary-tree
0904-fruit-into-baskets
0987-vertical-order-traversal-of-a-binary-tree
1684-count-the-number-of-consistent-strings
1781-sum-of-beauty-of-all-substrings
2657-find-the-prefix-common-array-of-two-arrays
3016-minimum-number-of-pushes-to-type-word-ii
3518-smallest-palindromic-rearrangement-ii
3541-find-most-frequent-vowel-and-consonant
3760-maximum-substrings-with-distinct-start

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0008-string-to-integer-atoi
0013-roman-to-integer
0014-longest-common-prefix
0020-valid-parentheses
0151-reverse-words-in-a-string
0205-isomorphic-strings
0402-remove-k-digits
0451-sort-characters-by-frequency
0535-encode-and-decode-tinyurl
0771-jewels-and-stones
0796-rotate-string
1021-remove-outermost-parentheses
1415-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1614-maximum-nesting-depth-of-the-parentheses
1684-count-the-number-of-consistent-strings
1689-partitioning-into-minimum-number-of-deci-binary-numbers
1769-minimum-number-of-operations-to-move-all-balls-to-each-box
1781-sum-of-beauty-of-all-substrings
1903-largest-odd-number-in-string
2000-reverse-prefix-of-word
2125-number-of-laser-beams-in-a-bank
2942-find-words-containing-character
3014-minimum-number-of-pushes-to-type-word-i
3016-minimum-number-of-pushes-to-type-word-ii
3110-score-of-a-string
3211-generate-binary-strings-without-adjacent-zeros
3498-reverse-degree-of-a-string
3517-smallest-palindromic-rearrangement-i
3518-smallest-palindromic-rearrangement-ii
3541-find-most-frequent-vowel-and-consonant
3760-maximum-substrings-with-distinct-start
3794-reverse-string-prefix
3838-weighted-word-mapping

Simulation

0735-asteroid-collision
1260-shift-2d-grid
3304-find-the-k-th-character-in-string-game-i
3498-reverse-degree-of-a-string
3838-weighted-word-mapping
3867-sum-of-gcd-of-formed-pairs

Prefix Sum

1004-max-consecutive-ones-iii
1423-maximum-points-you-can-obtain-from-cards
1769-minimum-number-of-operations-to-move-all-balls-to-each-box

Two Pointers

0005-longest-palindromic-substring
0042-trapping-rain-water
0151-reverse-words-in-a-string
2000-reverse-prefix-of-word
3794-reverse-string-prefix
3867-sum-of-gcd-of-formed-pairs

Counting

0451-sort-characters-by-frequency
1684-count-the-number-of-consistent-strings
1781-sum-of-beauty-of-all-substrings
3016-minimum-number-of-pushes-to-type-word-ii
3518-smallest-palindromic-rearrangement-ii
3541-find-most-frequent-vowel-and-consonant

Bit Manipulation

0029-divide-two-integers
0078-subsets
0137-single-number-ii
0231-power-of-two
0260-single-number-iii
1486-xor-operation-in-an-array
1684-count-the-number-of-consistent-strings
1720-decode-xored-array
1863-sum-of-all-subset-xor-totals
2044-count-number-of-maximum-bitwise-or-subsets
2220-minimum-bit-flips-to-convert-number
2433-find-the-original-array-of-prefix-xor
2657-find-the-prefix-common-array-of-two-arrays
2859-sum-of-values-at-indices-with-k-set-bits
3211-generate-binary-strings-without-adjacent-zeros
3304-find-the-k-th-character-in-string-game-i
3514-number-of-unique-xor-triplets-ii

Backtracking

0039-combination-sum
0078-subsets
1415-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1863-sum-of-all-subset-xor-totals
2044-count-number-of-maximum-bitwise-or-subsets
3211-generate-binary-strings-without-adjacent-zeros

Design

0155-min-stack
0535-encode-and-decode-tinyurl

Hash Function

0535-encode-and-decode-tinyurl

Math

0013-roman-to-integer
0029-divide-two-integers
0050-powx-n
0204-count-primes
0231-power-of-two
0628-maximum-product-of-three-numbers
1486-xor-operation-in-an-array
1863-sum-of-all-subset-xor-totals
1903-largest-odd-number-in-string
1979-find-greatest-common-divisor-of-array
2125-number-of-laser-beams-in-a-bank
3014-minimum-number-of-pushes-to-type-word-i
3304-find-the-k-th-character-in-string-game-i
3345-smallest-divisible-digit-product-i
3514-number-of-unique-xor-triplets-ii
3518-smallest-palindromic-rearrangement-ii
3536-maximum-product-of-two-digits
3658-gcd-of-odd-and-even-sums
3867-sum-of-gcd-of-formed-pairs

Stack

0020-valid-parentheses
0042-trapping-rain-water
0084-largest-rectangle-in-histogram
0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0155-min-stack
0402-remove-k-digits
0496-next-greater-element-i
0503-next-greater-element-ii
0735-asteroid-collision
0907-sum-of-subarray-minimums
1021-remove-outermost-parentheses
1475-final-prices-with-a-special-discount-in-a-shop
1614-maximum-nesting-depth-of-the-parentheses
2000-reverse-prefix-of-word
2104-sum-of-subarray-ranges

Trie

0014-longest-common-prefix

String Matching

0796-rotate-string

Dynamic Programming

0005-longest-palindromic-substring
0042-trapping-rain-water
0124-binary-tree-maximum-path-sum
0907-sum-of-subarray-minimums

Heap (Priority Queue)

0451-sort-characters-by-frequency
1464-maximum-product-of-two-elements-in-an-array

Bucket Sort

0451-sort-characters-by-frequency

Recursion

0050-powx-n
0231-power-of-two
3304-find-the-k-th-character-in-string-game-i

Enumeration

0204-count-primes
1863-sum-of-all-subset-xor-totals
2044-count-number-of-maximum-bitwise-or-subsets
3345-smallest-divisible-digit-product-i
3514-number-of-unique-xor-triplets-ii

Number Theory

0204-count-primes
1979-find-greatest-common-divisor-of-array
3658-gcd-of-odd-and-even-sums
3867-sum-of-gcd-of-formed-pairs

Combinatorics

1863-sum-of-all-subset-xor-totals
3518-smallest-palindromic-rearrangement-ii

Monotonic Stack

0042-trapping-rain-water
0084-largest-rectangle-in-histogram
0402-remove-k-digits
0496-next-greater-element-i
0503-next-greater-element-ii
0907-sum-of-subarray-minimums
1475-final-prices-with-a-special-discount-in-a-shop
2104-sum-of-subarray-ranges

Counting Sort

3517-smallest-palindromic-rearrangement-i

Sliding Window

0003-longest-substring-without-repeating-characters
0904-fruit-into-baskets
1004-max-consecutive-ones-iii
1423-maximum-points-you-can-obtain-from-cards

Tree

0094-binary-tree-inorder-traversal
0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0124-binary-tree-maximum-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0863-all-nodes-distance-k-in-binary-tree
0987-vertical-order-traversal-of-a-binary-tree

Depth-First Search

0094-binary-tree-inorder-traversal
0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0124-binary-tree-maximum-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0863-all-nodes-distance-k-in-binary-tree
0987-vertical-order-traversal-of-a-binary-tree

Binary Tree

0094-binary-tree-inorder-traversal
0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0124-binary-tree-maximum-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0236-lowest-common-ancestor-of-a-binary-tree
0543-diameter-of-binary-tree
0863-all-nodes-distance-k-in-binary-tree
0987-vertical-order-traversal-of-a-binary-tree

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0199-binary-tree-right-side-view
0863-all-nodes-distance-k-in-binary-tree
0987-vertical-order-traversal-of-a-binary-tree

DP on Trees

0124-binary-tree-maximum-path-sum
0543-diameter-of-binary-tree

Binary Lifting

0236-lowest-common-ancestor-of-a-binary-tree

Lowest Common Ancestor

0236-lowest-common-ancestor-of-a-binary-tree

About

My LeetCode Archive

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages