Skip to content

iambyt3z/leetcode-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode-Solutions

Collection of LeetCode questions solved

LeetCode Topics

Array

0047-permutations-ii
0073-set-matrix-zeroes
0075-sort-colors
0084-largest-rectangle-in-histogram
0135-candy
0329-longest-increasing-path-in-a-matrix
0368-largest-divisible-subset
0416-partition-equal-subset-sum
0581-shortest-unsorted-continuous-subarray
0805-escape-the-ghosts
0854-making-a-large-island
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0940-fruit-into-baskets
1129-longest-string-chain
1219-longest-well-performing-interval
1364-tuple-with-same-product
1396-count-servers-that-communicate
1477-product-of-the-last-k-numbers
1605-minimum-number-of-days-to-make-m-bouquets
1631-number-of-sub-arrays-with-odd-sum
1633-minimum-number-of-increments-on-subarrays-to-form-a-target-array
1849-maximum-absolute-sum-of-any-subarray
1878-check-if-array-is-sorted-and-rotated
1888-find-nearest-point-that-has-the-same-x-or-y-coordinate
1902-car-fleet-ii
1927-maximum-ascending-subarray-sum
1993-sum-of-all-subset-xor-totals
2107-find-unique-binary-string
2237-longest-palindrome-by-concatenating-two-letter-words
2240-intervals-between-identical-elements
2249-count-the-hidden-sequences
2262-solving-questions-with-brainpower
2342-minimum-average-difference
2355-maximum-consecutive-floors-without-special-floors
2393-match-substring-after-replacement
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2519-find-the-original-array-of-prefix-xor
2527-count-subarrays-with-fixed-bounds
2551-apply-operations-to-an-array
2564-most-profitable-path-in-a-tree
2614-maximum-count-of-positive-integer-and-negative-integer
2707-merge-two-2d-arrays-by-summing-values
2856-count-complete-subarrays-in-an-array
2915-count-of-interesting-subarrays
3142-longest-unequal-adjacent-groups-subsequence-ii
3143-longest-unequal-adjacent-groups-subsequence-i
3152-maximum-value-of-an-ordered-triplet-ii
3154-maximum-value-of-an-ordered-triplet-i
3194-find-words-containing-character
3213-count-subarrays-where-max-element-appears-at-least-k-times
3219-make-lexicographically-smallest-array-by-swapping-elements
3227-find-missing-and-repeated-values
3307-find-the-maximum-sum-of-node-values
3321-type-of-triangle
3332-minimum-operations-to-exceed-threshold-value-ii
3372-longest-strictly-increasing-or-strictly-decreasing-subarray
3429-special-array-i
3434-find-the-number-of-distinct-colors-among-the-balls
3483-alternating-groups-ii
3639-zero-array-transformation-i
3643-zero-array-transformation-ii
3647-zero-array-transformation-iii
3656-minimum-number-of-operations-to-make-elements-in-array-distinct

Depth-First Search

0329-longest-increasing-path-in-a-matrix
0684-redundant-connection
0820-find-eventual-safe-states
0854-making-a-large-island
1092-maximum-difference-between-node-and-ancestor
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
1396-count-servers-that-communicate
1558-course-schedule-iv
2438-find-closest-node-to-given-two-nodes
2564-most-profitable-path-in-a-tree
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii

Breadth-First Search

0329-longest-increasing-path-in-a-matrix
0684-redundant-connection
0820-find-eventual-safe-states
0854-making-a-large-island
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
1396-count-servers-that-communicate
1558-course-schedule-iv
2564-most-profitable-path-in-a-tree
2583-divide-nodes-into-the-maximum-number-of-groups
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii

Union Find

0684-redundant-connection
0854-making-a-large-island
1396-count-servers-that-communicate
2583-divide-nodes-into-the-maximum-number-of-groups
3219-make-lexicographically-smallest-array-by-swapping-elements

Matrix

0073-set-matrix-zeroes
0329-longest-increasing-path-in-a-matrix
0854-making-a-large-island
1396-count-servers-that-communicate
3227-find-missing-and-repeated-values

Counting

1160-letter-tile-possibilities
1364-tuple-with-same-product
1396-count-servers-that-communicate
1986-largest-color-value-in-a-directed-graph
2237-longest-palindrome-by-concatenating-two-letter-words
2448-count-number-of-bad-pairs
2614-maximum-count-of-positive-integer-and-negative-integer
3629-total-characters-in-string-after-transformations-i
3630-total-characters-in-string-after-transformations-ii

Graph

0329-longest-increasing-path-in-a-matrix
0684-redundant-connection
0820-find-eventual-safe-states
1558-course-schedule-iv
1986-largest-color-value-in-a-directed-graph
2438-find-closest-node-to-given-two-nodes
2564-most-profitable-path-in-a-tree
2583-divide-nodes-into-the-maximum-number-of-groups

Topological Sort

0329-longest-increasing-path-in-a-matrix
0820-find-eventual-safe-states
1558-course-schedule-iv
1986-largest-color-value-in-a-directed-graph

Sorting

0047-permutations-ii
0075-sort-colors
0368-largest-divisible-subset
0581-shortest-unsorted-continuous-subarray
1129-longest-string-chain
2355-maximum-consecutive-floors-without-special-floors
2473-max-sum-of-a-pair-with-equal-sum-of-digits
3219-make-lexicographically-smallest-array-by-swapping-elements
3307-find-the-maximum-sum-of-node-values
3321-type-of-triangle
3647-zero-array-transformation-iii

Stack

0084-largest-rectangle-in-histogram
0581-shortest-unsorted-continuous-subarray
1219-longest-well-performing-interval
1633-minimum-number-of-increments-on-subarrays-to-form-a-target-array
1902-car-fleet-ii
2021-remove-all-occurrences-of-a-substring
2456-construct-smallest-number-from-di-string
3447-clear-digits

Monotonic Stack

0084-largest-rectangle-in-histogram
0581-shortest-unsorted-continuous-subarray
1219-longest-well-performing-interval
1633-minimum-number-of-increments-on-subarrays-to-form-a-target-array
1902-car-fleet-ii

Bit Manipulation

1993-sum-of-all-subset-xor-totals
2519-find-the-original-array-of-prefix-xor
3307-find-the-maximum-sum-of-node-values

Math

0009-palindrome-number
0368-largest-divisible-subset
0805-escape-the-ghosts
1411-convert-binary-number-in-a-linked-list-to-integer
1477-product-of-the-last-k-numbers
1500-count-largest-group
1631-number-of-sub-arrays-with-odd-sum
1902-car-fleet-ii
1993-sum-of-all-subset-xor-totals
2415-count-the-number-of-ideal-arrays
2448-count-number-of-bad-pairs
2649-count-total-number-of-colored-cells
2802-find-the-punishment-number-of-an-integer
3172-divisible-and-non-divisible-sums-difference
3201-distribute-candies-among-children-ii
3227-find-missing-and-repeated-values
3321-type-of-triangle
3629-total-characters-in-string-after-transformations-i
3630-total-characters-in-string-after-transformations-ii

Heap (Priority Queue)

1902-car-fleet-ii
2434-design-a-number-container-system
2473-max-sum-of-a-pair-with-equal-sum-of-digits
3332-minimum-operations-to-exceed-threshold-value-ii
3647-zero-array-transformation-iii

Binary Search

1605-minimum-number-of-days-to-make-m-bouquets
2614-maximum-count-of-positive-integer-and-negative-integer
3643-zero-array-transformation-ii

Dynamic Programming

0329-longest-increasing-path-in-a-matrix
0368-largest-divisible-subset
0416-partition-equal-subset-sum
0905-length-of-longest-fibonacci-subsequence
1129-longest-string-chain
1527-number-of-ways-to-paint-n-3-grid
1631-number-of-sub-arrays-with-odd-sum
1633-minimum-number-of-increments-on-subarrays-to-form-a-target-array
1849-maximum-absolute-sum-of-any-subarray
1986-largest-color-value-in-a-directed-graph
2061-painting-a-grid-with-three-different-colors
2262-solving-questions-with-brainpower
2415-count-the-number-of-ideal-arrays
3142-longest-unequal-adjacent-groups-subsequence-ii
3143-longest-unequal-adjacent-groups-subsequence-i
3307-find-the-maximum-sum-of-node-values
3629-total-characters-in-string-after-transformations-i
3630-total-characters-in-string-after-transformations-ii

Memoization

0329-longest-increasing-path-in-a-matrix
1986-largest-color-value-in-a-directed-graph

Hash Table

0073-set-matrix-zeroes
0146-lru-cache
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0940-fruit-into-baskets
1129-longest-string-chain
1160-letter-tile-possibilities
1218-lowest-common-ancestor-of-deepest-leaves
1219-longest-well-performing-interval
1364-tuple-with-same-product
1387-find-elements-in-a-contaminated-binary-tree
1460-number-of-substrings-containing-all-three-characters
1500-count-largest-group
1986-largest-color-value-in-a-directed-graph
2107-find-unique-binary-string
2237-longest-palindrome-by-concatenating-two-letter-words
2240-intervals-between-identical-elements
2393-match-substring-after-replacement
2434-design-a-number-container-system
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2707-merge-two-2d-arrays-by-summing-values
2856-count-complete-subarrays-in-an-array
2915-count-of-interesting-subarrays
3227-find-missing-and-repeated-values
3434-find-the-number-of-distinct-colors-among-the-balls
3629-total-characters-in-string-after-transformations-i
3630-total-characters-in-string-after-transformations-ii
3656-minimum-number-of-operations-to-make-elements-in-array-distinct

Simulation

2021-remove-all-occurrences-of-a-substring
2551-apply-operations-to-an-array
3332-minimum-operations-to-exceed-threshold-value-ii
3434-find-the-number-of-distinct-colors-among-the-balls
3447-clear-digits

Design

0146-lru-cache
1387-find-elements-in-a-contaminated-binary-tree
1477-product-of-the-last-k-numbers
2434-design-a-number-container-system

Ordered Set

2434-design-a-number-container-system

String

1129-longest-string-chain
1160-letter-tile-possibilities
1460-number-of-substrings-containing-all-three-characters
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
2021-remove-all-occurrences-of-a-substring
2107-find-unique-binary-string
2237-longest-palindrome-by-concatenating-two-letter-words
2393-match-substring-after-replacement
2456-construct-smallest-number-from-di-string
3142-longest-unequal-adjacent-groups-subsequence-ii
3143-longest-unequal-adjacent-groups-subsequence-i
3194-find-words-containing-character
3447-clear-digits
3629-total-characters-in-string-after-transformations-i
3630-total-characters-in-string-after-transformations-ii

Linked List

0025-reverse-nodes-in-k-group
0146-lru-cache
1411-convert-binary-number-in-a-linked-list-to-integer

Greedy

0135-candy
0581-shortest-unsorted-continuous-subarray
1633-minimum-number-of-increments-on-subarrays-to-form-a-target-array
2237-longest-palindrome-by-concatenating-two-letter-words
2456-construct-smallest-number-from-di-string
3143-longest-unequal-adjacent-groups-subsequence-i
3307-find-the-maximum-sum-of-node-values
3647-zero-array-transformation-iii

Two Pointers

0075-sort-colors
0581-shortest-unsorted-continuous-subarray
1129-longest-string-chain
2551-apply-operations-to-an-array
2707-merge-two-2d-arrays-by-summing-values

Recursion

0025-reverse-nodes-in-k-group

Data Stream

1477-product-of-the-last-k-numbers

Prefix Sum

1219-longest-well-performing-interval
1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
2240-intervals-between-identical-elements
2249-count-the-hidden-sequences
2342-minimum-average-difference
2915-count-of-interesting-subarrays
3639-zero-array-transformation-i
3643-zero-array-transformation-ii
3647-zero-array-transformation-iii

Backtracking

0047-permutations-ii
1160-letter-tile-possibilities
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1993-sum-of-all-subset-xor-totals
2107-find-unique-binary-string
2456-construct-smallest-number-from-di-string
2802-find-the-punishment-number-of-an-integer

Tree

0925-construct-binary-tree-from-preorder-and-postorder-traversal
1092-maximum-difference-between-node-and-ancestor
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
2564-most-profitable-path-in-a-tree
3307-find-the-maximum-sum-of-node-values
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii

Binary Tree

0925-construct-binary-tree-from-preorder-and-postorder-traversal
1092-maximum-difference-between-node-and-ancestor
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree

Divide and Conquer

0925-construct-binary-tree-from-preorder-and-postorder-traversal

String Matching

2393-match-substring-after-replacement

Sliding Window

0940-fruit-into-baskets
1460-number-of-substrings-containing-all-three-characters
2527-count-subarrays-with-fixed-bounds
2856-count-complete-subarrays-in-an-array
3213-count-subarrays-where-max-element-appears-at-least-k-times
3483-alternating-groups-ii

Combinatorics

1993-sum-of-all-subset-xor-totals
2415-count-the-number-of-ideal-arrays
3201-distribute-candies-among-children-ii

Enumeration

1993-sum-of-all-subset-xor-totals
3201-distribute-candies-among-children-ii

Number Theory

2415-count-the-number-of-ideal-arrays

Queue

2527-count-subarrays-with-fixed-bounds

Monotonic Queue

2527-count-subarrays-with-fixed-bounds

Doubly-Linked List

0146-lru-cache

About

Collection of LeetCode questions solved

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages