Skip to content

absaw/Leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode

Leetcode Submissions

LeetCode Topics

Dynamic Programming

0005-longest-palindromic-substring
0022-generate-parentheses
0042-trapping-rain-water
0053-maximum-subarray
0062-unique-paths
0064-minimum-path-sum
0070-climbing-stairs
0072-edit-distance
0091-decode-ways
0097-interleaving-string
0115-distinct-subsequences
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0124-binary-tree-maximum-path-sum
0139-word-break
0152-maximum-product-subarray
0198-house-robber
0213-house-robber-ii
0300-longest-increasing-subsequence
0309-best-time-to-buy-and-sell-stock-with-cooldown
0322-coin-change
0329-longest-increasing-path-in-a-matrix
0338-counting-bits
0392-is-subsequence
0416-partition-equal-subset-sum
0435-non-overlapping-intervals
0494-target-sum
0518-coin-change-ii
0542-01-matrix
0647-palindromic-substrings
0698-partition-to-k-equal-sum-subsets
0747-min-cost-climbing-stairs
0803-cheapest-flights-within-k-stops
0905-length-of-longest-fibonacci-subsequence
1063-best-sightseeing-pair
1250-longest-common-subsequence

Bit Manipulation

0078-subsets
0090-subsets-ii
0190-reverse-bits
0191-number-of-1-bits
0268-missing-number
0287-find-the-duplicate-number
0338-counting-bits
0371-sum-of-two-integers
0698-partition-to-k-equal-sum-subsets

Linked List

0002-add-two-numbers
0019-remove-nth-node-from-end-of-list
0021-merge-two-sorted-lists
0023-merge-k-sorted-lists
0061-rotate-list
0109-convert-sorted-list-to-binary-search-tree
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0138-copy-list-with-random-pointer
0141-linked-list-cycle
0143-reorder-list
0146-lru-cache
0160-intersection-of-two-linked-lists
0206-reverse-linked-list
0355-design-twitter
0908-middle-of-the-linked-list

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists
0050-powx-n
0143-reorder-list
0206-reverse-linked-list

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0012-integer-to-roman
0013-roman-to-integer
0036-valid-sudoku
0049-group-anagrams
0073-set-matrix-zeroes
0076-minimum-window-substring
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0127-word-ladder
0128-longest-consecutive-sequence
0133-clone-graph
0138-copy-list-with-random-pointer
0139-word-break
0141-linked-list-cycle
0146-lru-cache
0160-intersection-of-two-linked-lists
0169-majority-element
0205-isomorphic-strings
0208-implement-trie-prefix-tree
0217-contains-duplicate
0242-valid-anagram
0268-missing-number
0347-top-k-frequent-elements
0349-intersection-of-two-arrays
0355-design-twitter
0383-ransom-note
0409-longest-palindrome
0424-longest-repeating-character-replacement
0496-next-greater-element-i
0567-permutation-in-string
0621-task-scheduler
0778-reorganize-string
0905-length-of-longest-fibonacci-subsequence
1023-time-based-key-value-store
1353-find-resultant-array-after-removing-anagrams
1694-make-sum-divisible-by-p
1798-max-number-of-k-sum-pairs
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
3434-find-the-number-of-distinct-colors-among-the-balls

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0008-string-to-integer-atoi
0012-integer-to-roman
0013-roman-to-integer
0014-longest-common-prefix
0020-valid-parentheses
0022-generate-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0049-group-anagrams
0072-edit-distance
0076-minimum-window-substring
0079-word-search
0091-decode-ways
0093-restore-ip-addresses
0097-interleaving-string
0115-distinct-subsequences
0125-valid-palindrome
0127-word-ladder
0139-word-break
0151-reverse-words-in-a-string
0205-isomorphic-strings
0208-implement-trie-prefix-tree
0211-design-add-and-search-words-data-structure
0212-word-search-ii
0242-valid-anagram
0297-serialize-and-deserialize-binary-tree
0383-ransom-note
0392-is-subsequence
0409-longest-palindrome
0412-fizz-buzz
0424-longest-repeating-character-replacement
0459-repeated-substring-pattern
0567-permutation-in-string
0647-palindromic-substrings
0686-repeated-string-match
0778-reorganize-string
1023-time-based-key-value-store
1250-longest-common-subsequence
1353-find-resultant-array-after-removing-anagrams
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
2021-remove-all-occurrences-of-a-substring
2456-construct-smallest-number-from-di-string

Tree

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
0109-convert-sorted-list-to-binary-search-tree
0110-balanced-binary-tree
0112-path-sum
0113-path-sum-ii
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0124-binary-tree-maximum-path-sum
0199-binary-tree-right-side-view
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0297-serialize-and-deserialize-binary-tree
0515-find-largest-value-in-each-tree-row
0543-diameter-of-binary-tree
0563-binary-tree-tilt
0572-subtree-of-another-tree
0789-kth-largest-element-in-a-stream
1544-count-good-nodes-in-binary-tree
2564-most-profitable-path-in-a-tree

Depth-First Search

0098-validate-binary-search-tree
0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0112-path-sum
0113-path-sum-ii
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0124-binary-tree-maximum-path-sum
0130-surrounded-regions
0133-clone-graph
0199-binary-tree-right-side-view
0200-number-of-islands
0207-course-schedule
0210-course-schedule-ii
0211-design-add-and-search-words-data-structure
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0297-serialize-and-deserialize-binary-tree
0329-longest-increasing-path-in-a-matrix
0332-reconstruct-itinerary
0417-pacific-atlantic-water-flow
0515-find-largest-value-in-each-tree-row
0529-minesweeper
0543-diameter-of-binary-tree
0563-binary-tree-tilt
0572-subtree-of-another-tree
0684-redundant-connection
0695-max-area-of-island
0733-flood-fill
0744-network-delay-time
0794-swim-in-rising-water
0803-cheapest-flights-within-k-stops
0854-making-a-large-island
1544-count-good-nodes-in-binary-tree
2564-most-profitable-path-in-a-tree

Binary Search Tree

0004-median-of-two-sorted-arrays
0033-search-in-rotated-sorted-array
0074-search-a-2d-matrix
0098-validate-binary-search-tree
0108-convert-sorted-array-to-binary-search-tree
0109-convert-sorted-list-to-binary-search-tree
0153-find-minimum-in-rotated-sorted-array
0167-two-sum-ii-input-array-is-sorted
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0268-missing-number
0287-find-the-duplicate-number
0300-longest-increasing-subsequence
0349-intersection-of-two-arrays
0789-kth-largest-element-in-a-stream
0792-binary-search
0794-swim-in-rising-water
0907-koko-eating-bananas
1023-time-based-key-value-store
1977-minimum-interval-to-include-each-query

Binary Tree

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
0109-convert-sorted-list-to-binary-search-tree
0110-balanced-binary-tree
0112-path-sum
0113-path-sum-ii
0114-flatten-binary-tree-to-linked-list
0116-populating-next-right-pointers-in-each-node
0124-binary-tree-maximum-path-sum
0199-binary-tree-right-side-view
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0236-lowest-common-ancestor-of-a-binary-tree
0297-serialize-and-deserialize-binary-tree
0515-find-largest-value-in-each-tree-row
0543-diameter-of-binary-tree
0563-binary-tree-tilt
0572-subtree-of-another-tree
0789-kth-largest-element-in-a-stream
1544-count-good-nodes-in-binary-tree

Divide and Conquer

0004-median-of-two-sorted-arrays
0023-merge-k-sorted-lists
0053-maximum-subarray
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
0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements
0948-sort-an-array
1014-k-closest-points-to-origin

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0011-container-with-most-water
0015-3sum
0033-search-in-rotated-sorted-array
0036-valid-sudoku
0039-combination-sum
0042-trapping-rain-water
0046-permutations
0048-rotate-image
0049-group-anagrams
0053-maximum-subarray
0054-spiral-matrix
0056-merge-intervals
0057-insert-interval
0064-minimum-path-sum
0073-set-matrix-zeroes
0074-search-a-2d-matrix
0075-sort-colors
0078-subsets
0079-word-search
0088-merge-sorted-array
0090-subsets-ii
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
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0128-longest-consecutive-sequence
0130-surrounded-regions
0134-gas-station
0139-word-break
0150-evaluate-reverse-polish-notation
0152-maximum-product-subarray
0153-find-minimum-in-rotated-sorted-array
0167-two-sum-ii-input-array-is-sorted
0169-majority-element
0198-house-robber
0200-number-of-islands
0212-word-search-ii
0213-house-robber-ii
0215-kth-largest-element-in-an-array
0217-contains-duplicate
0238-product-of-array-except-self
0239-sliding-window-maximum
0252-meeting-rooms
0268-missing-number
0286-walls-and-gates
0287-find-the-duplicate-number
0289-game-of-life
0300-longest-increasing-subsequence
0309-best-time-to-buy-and-sell-stock-with-cooldown
0322-coin-change
0329-longest-increasing-path-in-a-matrix
0347-top-k-frequent-elements
0349-intersection-of-two-arrays
0416-partition-equal-subset-sum
0417-pacific-atlantic-water-flow
0435-non-overlapping-intervals
0494-target-sum
0496-next-greater-element-i
0518-coin-change-ii
0529-minesweeper
0542-01-matrix
0621-task-scheduler
0695-max-area-of-island
0698-partition-to-k-equal-sum-subsets
0733-flood-fill
0739-daily-temperatures
0747-min-cost-climbing-stairs
0792-binary-search
0794-swim-in-rising-water
0854-making-a-large-island
0883-car-fleet
0905-length-of-longest-fibonacci-subsequence
0907-koko-eating-bananas
0948-sort-an-array
1014-k-closest-points-to-origin
1036-rotting-oranges
1063-best-sightseeing-pair
1127-last-stone-weight
1353-find-resultant-array-after-removing-anagrams
1694-make-sum-divisible-by-p
1706-min-cost-to-connect-all-points
1798-max-number-of-k-sum-pairs
1819-construct-the-lexicographically-largest-valid-sequence
1927-maximum-ascending-subarray-sum
1977-minimum-interval-to-include-each-query
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2564-most-profitable-path-in-a-tree
2692-take-gifts-from-the-richest-pile
3434-find-the-number-of-distinct-colors-among-the-balls

Math

0002-add-two-numbers
0012-integer-to-roman
0013-roman-to-integer
0048-rotate-image
0050-powx-n
0062-unique-paths
0070-climbing-stairs
0150-evaluate-reverse-polish-notation
0268-missing-number
0371-sum-of-two-integers
0412-fizz-buzz
1014-k-closest-points-to-origin
2448-count-number-of-bad-pairs
2610-closest-prime-numbers-in-range
2802-find-the-punishment-number-of-an-integer

Sorting

0015-3sum
0049-group-anagrams
0056-merge-intervals
0075-sort-colors
0088-merge-sorted-array
0169-majority-element
0215-kth-largest-element-in-an-array
0217-contains-duplicate
0242-valid-anagram
0252-meeting-rooms
0268-missing-number
0295-find-median-from-data-stream
0347-top-k-frequent-elements
0349-intersection-of-two-arrays
0435-non-overlapping-intervals
0621-task-scheduler
0778-reorganize-string
0883-car-fleet
0948-sort-an-array
1014-k-closest-points-to-origin
1353-find-resultant-array-after-removing-anagrams
1798-max-number-of-k-sum-pairs
1977-minimum-interval-to-include-each-query
2473-max-sum-of-a-pair-with-equal-sum-of-digits

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0112-path-sum
0116-populating-next-right-pointers-in-each-node
0127-word-ladder
0130-surrounded-regions
0133-clone-graph
0199-binary-tree-right-side-view
0200-number-of-islands
0207-course-schedule
0210-course-schedule-ii
0226-invert-binary-tree
0286-walls-and-gates
0297-serialize-and-deserialize-binary-tree
0322-coin-change
0329-longest-increasing-path-in-a-matrix
0417-pacific-atlantic-water-flow
0515-find-largest-value-in-each-tree-row
0529-minesweeper
0542-01-matrix
0684-redundant-connection
0695-max-area-of-island
0733-flood-fill
0744-network-delay-time
0794-swim-in-rising-water
0803-cheapest-flights-within-k-stops
0854-making-a-large-island
1036-rotting-oranges
1544-count-good-nodes-in-binary-tree
2564-most-profitable-path-in-a-tree

Database

0175-combine-two-tables
0181-employees-earning-more-than-their-managers
0182-duplicate-emails
0183-customers-who-never-order
0197-rising-temperature

Backtracking

0022-generate-parentheses
0039-combination-sum
0046-permutations
0078-subsets
0079-word-search
0090-subsets-ii
0093-restore-ip-addresses
0113-path-sum-ii
0212-word-search-ii
0494-target-sum
0698-partition-to-k-equal-sum-subsets
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1819-construct-the-lexicographically-largest-valid-sequence
2456-construct-smallest-number-from-di-string
2802-find-the-punishment-number-of-an-integer

Union Find

0128-longest-consecutive-sequence
0130-surrounded-regions
0200-number-of-islands
0684-redundant-connection
0695-max-area-of-island
0794-swim-in-rising-water
0854-making-a-large-island
1706-min-cost-to-connect-all-points

Matrix

0036-valid-sudoku
0048-rotate-image
0054-spiral-matrix
0064-minimum-path-sum
0073-set-matrix-zeroes
0074-search-a-2d-matrix
0079-word-search
0130-surrounded-regions
0200-number-of-islands
0212-word-search-ii
0286-walls-and-gates
0289-game-of-life
0329-longest-increasing-path-in-a-matrix
0417-pacific-atlantic-water-flow
0529-minesweeper
0542-01-matrix
0695-max-area-of-island
0733-flood-fill
0794-swim-in-rising-water
0854-making-a-large-island
1036-rotting-oranges

Graph

0133-clone-graph
0207-course-schedule
0210-course-schedule-ii
0329-longest-increasing-path-in-a-matrix
0332-reconstruct-itinerary
0684-redundant-connection
0744-network-delay-time
0803-cheapest-flights-within-k-stops
1706-min-cost-to-connect-all-points
2564-most-profitable-path-in-a-tree

Two Pointers

0005-longest-palindromic-substring
0011-container-with-most-water
0015-3sum
0019-remove-nth-node-from-end-of-list
0028-find-the-index-of-the-first-occurrence-in-a-string
0042-trapping-rain-water
0061-rotate-list
0075-sort-colors
0088-merge-sorted-array
0125-valid-palindrome
0141-linked-list-cycle
0143-reorder-list
0151-reverse-words-in-a-string
0160-intersection-of-two-linked-lists
0167-two-sum-ii-input-array-is-sorted
0287-find-the-duplicate-number
0295-find-median-from-data-stream
0349-intersection-of-two-arrays
0392-is-subsequence
0567-permutation-in-string
0647-palindromic-substrings
0908-middle-of-the-linked-list
1798-max-number-of-k-sum-pairs

Sliding Window

0003-longest-substring-without-repeating-characters
0076-minimum-window-substring
0239-sliding-window-maximum
0424-longest-repeating-character-replacement
0567-permutation-in-string

Greedy

0011-container-with-most-water
0122-best-time-to-buy-and-sell-stock-ii
0134-gas-station
0409-longest-palindrome
0435-non-overlapping-intervals
0621-task-scheduler
0778-reorganize-string
2456-construct-smallest-number-from-di-string

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
0459-repeated-substring-pattern
0572-subtree-of-another-tree
0686-repeated-string-match

Trie

0014-longest-common-prefix
0139-word-break
0208-implement-trie-prefix-tree
0211-design-add-and-search-words-data-structure
0212-word-search-ii

Counting

0169-majority-element
0347-top-k-frequent-elements
0383-ransom-note
0621-task-scheduler
0778-reorganize-string
2448-count-number-of-bad-pairs

Stack

0020-valid-parentheses
0042-trapping-rain-water
0114-flatten-binary-tree-to-linked-list
0143-reorder-list
0150-evaluate-reverse-polish-notation
0496-next-greater-element-i
0739-daily-temperatures
0883-car-fleet
2021-remove-all-occurrences-of-a-substring
2456-construct-smallest-number-from-di-string

Design

0146-lru-cache
0208-implement-trie-prefix-tree
0211-design-add-and-search-words-data-structure
0295-find-median-from-data-stream
0297-serialize-and-deserialize-binary-tree
0355-design-twitter
0789-kth-largest-element-in-a-stream
1023-time-based-key-value-store

Memoization

0070-climbing-stairs
0139-word-break
0329-longest-increasing-path-in-a-matrix
0698-partition-to-k-equal-sum-subsets

Heap (Priority Queue)

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array
0239-sliding-window-maximum
0295-find-median-from-data-stream
0347-top-k-frequent-elements
0355-design-twitter
0621-task-scheduler
0744-network-delay-time
0778-reorganize-string
0789-kth-largest-element-in-a-stream
0794-swim-in-rising-water
0803-cheapest-flights-within-k-stops
0948-sort-an-array
1014-k-closest-points-to-origin
1127-last-stone-weight
1977-minimum-interval-to-include-each-query
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2692-take-gifts-from-the-richest-pile

Bucket Sort

0347-top-k-frequent-elements
0948-sort-an-array

Quickselect

0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements
1014-k-closest-points-to-origin

Prefix Sum

0238-product-of-array-except-self
1694-make-sum-divisible-by-p

Doubly-Linked List

0146-lru-cache

Topological Sort

0207-course-schedule
0210-course-schedule-ii
0329-longest-increasing-path-in-a-matrix

Simulation

0054-spiral-matrix
0289-game-of-life
0412-fizz-buzz
2021-remove-all-occurrences-of-a-substring
2692-take-gifts-from-the-richest-pile
3434-find-the-number-of-distinct-colors-among-the-balls

Hash Function

0572-subtree-of-another-tree

Data Stream

0295-find-median-from-data-stream
0789-kth-largest-element-in-a-stream

Geometry

1014-k-closest-points-to-origin

Merge Sort

0023-merge-k-sorted-lists
0948-sort-an-array

Monotonic Stack

0042-trapping-rain-water
0496-next-greater-element-i
0739-daily-temperatures
0883-car-fleet

Radix Sort

0948-sort-an-array

Counting Sort

0948-sort-an-array

Queue

0239-sliding-window-maximum

Monotonic Queue

0239-sliding-window-maximum

Eulerian Circuit

0332-reconstruct-itinerary

Shortest Path

0744-network-delay-time
0803-cheapest-flights-within-k-stops

Minimum Spanning Tree

1706-min-cost-to-connect-all-points

Bitmask

0698-partition-to-k-equal-sum-subsets

Combinatorics

0062-unique-paths

Line Sweep

1977-minimum-interval-to-include-each-query

Number Theory

2610-closest-prime-numbers-in-range

About

Leetcode Submissions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published