Skip to content

GHOSTs-OCTOPUS/LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode

LeetCode Topics

Array

0322-coin-change
0368-largest-divisible-subset
0416-partition-equal-subset-sum
0854-making-a-large-island
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1335-maximum-candies-allocated-to-k-children
1364-tuple-with-same-product
1396-count-servers-that-communicate
1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1819-construct-the-lexicographically-largest-valid-sequence
1849-maximum-absolute-sum-of-any-subarray
1878-check-if-array-is-sorted-and-rotated
2107-find-unique-binary-string
2220-find-all-possible-recipes-from-given-supplies
2262-solving-questions-with-brainpower
2265-partition-array-according-to-given-pivot
2308-divide-array-into-equal-pairs
2448-count-number-of-bad-pairs
2478-longest-nice-subarray
2551-apply-operations-to-an-array
2614-maximum-count-of-positive-integer-and-negative-integer
2665-minimum-time-to-repair-cars
2681-put-marbles-in-bags
2685-first-completely-painted-row-or-column
2690-house-robber-iv
2707-merge-two-2d-arrays-by-summing-values
2764-maximum-number-of-fish-in-a-grid
3001-apply-operations-to-maximize-score
3152-maximum-value-of-an-ordered-triplet-ii
3154-maximum-value-of-an-ordered-triplet-i
3219-make-lexicographically-smallest-array-by-swapping-elements
3227-find-missing-and-repeated-values
3348-minimum-cost-walk-in-weighted-graph
3372-longest-strictly-increasing-or-strictly-decreasing-subarray
3429-special-array-i
3430-count-days-without-meetings
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii
3643-zero-array-transformation-ii
3657-check-if-grid-can-be-cut-into-sections

Depth-First Search

0684-redundant-connection
0820-find-eventual-safe-states
0854-making-a-large-island
1093-recover-a-tree-from-preorder-traversal
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
1396-count-servers-that-communicate
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting
2764-maximum-number-of-fish-in-a-grid
2793-count-the-number-of-complete-components

Breadth-First Search

0322-coin-change
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
2583-divide-nodes-into-the-maximum-number-of-groups
2764-maximum-number-of-fish-in-a-grid
2793-count-the-number-of-complete-components

Union Find

0684-redundant-connection
0854-making-a-large-island
1396-count-servers-that-communicate
2583-divide-nodes-into-the-maximum-number-of-groups
2764-maximum-number-of-fish-in-a-grid
2793-count-the-number-of-complete-components
3219-make-lexicographically-smallest-array-by-swapping-elements
3348-minimum-cost-walk-in-weighted-graph

Matrix

0854-making-a-large-island
1396-count-servers-that-communicate
2685-first-completely-painted-row-or-column
2764-maximum-number-of-fish-in-a-grid
3227-find-missing-and-repeated-values

Counting

1160-letter-tile-possibilities
1364-tuple-with-same-product
1396-count-servers-that-communicate
2308-divide-array-into-equal-pairs
2448-count-number-of-bad-pairs
2614-maximum-count-of-positive-integer-and-negative-integer

Graph

0684-redundant-connection
0820-find-eventual-safe-states
1558-course-schedule-iv
2090-number-of-ways-to-arrive-at-destination
2220-find-all-possible-recipes-from-given-supplies
2246-maximum-employees-to-be-invited-to-a-meeting
2583-divide-nodes-into-the-maximum-number-of-groups
2793-count-the-number-of-complete-components
3348-minimum-cost-walk-in-weighted-graph

Topological Sort

0820-find-eventual-safe-states
1558-course-schedule-iv
2090-number-of-ways-to-arrive-at-destination
2220-find-all-possible-recipes-from-given-supplies
2246-maximum-employees-to-be-invited-to-a-meeting

Sorting

0368-largest-divisible-subset
2681-put-marbles-in-bags
3001-apply-operations-to-maximize-score
3219-make-lexicographically-smallest-array-by-swapping-elements
3430-count-days-without-meetings
3657-check-if-grid-can-be-cut-into-sections

Dynamic Programming

0322-coin-change
0368-largest-divisible-subset
0416-partition-equal-subset-sum
0905-length-of-longest-fibonacci-subsequence
1170-shortest-common-supersequence
1631-number-of-sub-arrays-with-odd-sum
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1849-maximum-absolute-sum-of-any-subarray
2090-number-of-ways-to-arrive-at-destination
2262-solving-questions-with-brainpower

Hash Table

0768-partition-labels
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1160-letter-tile-possibilities
1218-lowest-common-ancestor-of-deepest-leaves
1364-tuple-with-same-product
1387-find-elements-in-a-contaminated-binary-tree
1460-number-of-substrings-containing-all-three-characters
2107-find-unique-binary-string
2220-find-all-possible-recipes-from-given-supplies
2308-divide-array-into-equal-pairs
2448-count-number-of-bad-pairs
2685-first-completely-painted-row-or-column
2707-merge-two-2d-arrays-by-summing-values
3227-find-missing-and-repeated-values
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii

String

0768-partition-labels
1093-recover-a-tree-from-preorder-traversal
1160-letter-tile-possibilities
1170-shortest-common-supersequence
1460-number-of-substrings-containing-all-three-characters
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
2021-remove-all-occurrences-of-a-substring
2107-find-unique-binary-string
2220-find-all-possible-recipes-from-given-supplies
2456-construct-smallest-number-from-di-string
2463-minimum-recolors-to-get-k-consecutive-black-blocks
3447-clear-digits
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii

Math

0368-largest-divisible-subset
1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
1889-check-if-number-is-a-sum-of-powers-of-three
2448-count-number-of-bad-pairs
2610-closest-prime-numbers-in-range
2649-count-total-number-of-colored-cells
2802-find-the-punishment-number-of-an-integer
3001-apply-operations-to-maximize-score
3227-find-missing-and-repeated-values

Design

1387-find-elements-in-a-contaminated-binary-tree
1477-product-of-the-last-k-numbers

Data Stream

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

Prefix Sum

1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3643-zero-array-transformation-ii

Stack

2021-remove-all-occurrences-of-a-substring
2456-construct-smallest-number-from-di-string
3001-apply-operations-to-maximize-score
3447-clear-digits

Simulation

2021-remove-all-occurrences-of-a-substring
2265-partition-array-according-to-given-pivot
2551-apply-operations-to-an-array
3447-clear-digits

Backtracking

1160-letter-tile-possibilities
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1819-construct-the-lexicographically-largest-valid-sequence
2107-find-unique-binary-string
2456-construct-smallest-number-from-di-string
2802-find-the-punishment-number-of-an-integer

Greedy

0768-partition-labels
2456-construct-smallest-number-from-di-string
2681-put-marbles-in-bags
3001-apply-operations-to-maximize-score

Tree

0925-construct-binary-tree-from-preorder-and-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree

Binary Tree

0925-construct-binary-tree-from-preorder-and-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
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

Two Pointers

0768-partition-labels
2265-partition-array-according-to-given-pivot
2551-apply-operations-to-an-array
2707-merge-two-2d-arrays-by-summing-values

Number Theory

2610-closest-prime-numbers-in-range
3001-apply-operations-to-maximize-score

Sliding Window

1460-number-of-substrings-containing-all-three-characters
2463-minimum-recolors-to-get-k-consecutive-black-blocks
2478-longest-nice-subarray
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii

Binary Search

1335-maximum-candies-allocated-to-k-children
2614-maximum-count-of-positive-integer-and-negative-integer
2665-minimum-time-to-repair-cars
2690-house-robber-iv
3643-zero-array-transformation-ii

Bit Manipulation

2308-divide-array-into-equal-pairs
2478-longest-nice-subarray
3348-minimum-cost-walk-in-weighted-graph
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

Queue

3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

Shortest Path

2090-number-of-ways-to-arrive-at-destination

Monotonic Stack

3001-apply-operations-to-maximize-score

Heap (Priority Queue)

2681-put-marbles-in-bags