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
0594-longest-harmonious-subsequence
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
1350-remove-sub-folders-from-the-filesystem
1364-tuple-with-same-product
1396-count-servers-that-communicate
1477-product-of-the-last-k-numbers
1478-maximum-number-of-events-that-can-be-attended
1510-find-lucky-integer-in-an-array
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
1631-number-of-sub-arrays-with-odd-sum
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1813-maximum-erasure-value
1819-construct-the-lexicographically-largest-valid-sequence
1849-maximum-absolute-sum-of-any-subarray
1878-check-if-array-is-sorted-and-rotated
1995-finding-pairs-with-a-certain-sum
2079-delete-duplicate-folders-in-system
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
2267-minimum-difference-in-sums-after-removal-of-elements
2308-divide-array-into-equal-pairs
2320-find-all-k-distant-indices-in-an-array
2400-minimum-score-after-removals-on-a-tree
2448-count-number-of-bad-pairs
2478-longest-nice-subarray
2479-meeting-rooms-iii
2497-maximum-matching-of-players-with-trainers
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
3741-reschedule-meetings-for-maximum-free-time-ii
3743-reschedule-meetings-for-maximum-free-time-i
3788-maximum-unique-subarray-sum-after-deletion
3789-maximize-subarrays-after-removing-one-conflicting-pair

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
1350-remove-sub-folders-from-the-filesystem
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
2400-minimum-score-after-removals-on-a-tree
2438-find-closest-node-to-given-two-nodes
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

0594-longest-harmonious-subsequence
1160-letter-tile-possibilities
1364-tuple-with-same-product
1396-count-servers-that-communicate
1510-find-lucky-integer-in-an-array
2140-longest-subsequence-repeated-k-times
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
2438-find-closest-node-to-given-two-nodes
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
0594-longest-harmonious-subsequence
1478-maximum-number-of-events-that-can-be-attended
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
2479-meeting-rooms-iii
2497-maximum-matching-of-players-with-trainers
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
2028-the-earliest-and-latest-rounds-where-players-compete
2090-number-of-ways-to-arrive-at-destination
2262-solving-questions-with-brainpower
2267-minimum-difference-in-sums-after-removal-of-elements

Hash Table

0594-longest-harmonious-subsequence
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
1510-find-lucky-integer-in-an-array
1813-maximum-erasure-value
1995-finding-pairs-with-a-certain-sum
2079-delete-duplicate-folders-in-system
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
2479-meeting-rooms-iii
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
3788-maximum-unique-subarray-sum-after-deletion

String

0768-partition-labels
1093-recover-a-tree-from-preorder-traversal
1160-letter-tile-possibilities
1170-shortest-common-supersequence
1302-delete-characters-to-make-fancy-string
1350-remove-sub-folders-from-the-filesystem
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
1818-maximum-score-from-removing-substrings
2021-remove-all-occurrences-of-a-substring
2079-delete-duplicate-folders-in-system
2107-find-unique-binary-string
2140-longest-subsequence-repeated-k-times
2220-find-all-possible-recipes-from-given-supplies
2456-construct-smallest-number-from-di-string
2463-minimum-recolors-to-get-k-consecutive-black-blocks
3396-valid-word
3447-clear-digits
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii

Math

0368-largest-divisible-subset
1411-convert-binary-number-in-a-linked-list-to-integer
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
3600-find-the-k-th-character-in-string-game-i

Design

1387-find-elements-in-a-contaminated-binary-tree
1477-product-of-the-last-k-numbers
1995-finding-pairs-with-a-certain-sum

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
3789-maximize-subarrays-after-removing-one-conflicting-pair

Stack

1818-maximum-score-from-removing-substrings
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
2479-meeting-rooms-iii
2551-apply-operations-to-an-array
3447-clear-digits
3600-find-the-k-th-character-in-string-game-i

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
2140-longest-subsequence-repeated-k-times
2456-construct-smallest-number-from-di-string
2802-find-the-punishment-number-of-an-integer

Greedy

0768-partition-labels
1478-maximum-number-of-events-that-can-be-attended
1818-maximum-score-from-removing-substrings
2140-longest-subsequence-repeated-k-times
2456-construct-smallest-number-from-di-string
2497-maximum-matching-of-players-with-trainers
2681-put-marbles-in-bags
3001-apply-operations-to-maximize-score
3741-reschedule-meetings-for-maximum-free-time-ii
3743-reschedule-meetings-for-maximum-free-time-i
3788-maximum-unique-subarray-sum-after-deletion

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
2400-minimum-score-after-removals-on-a-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
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
2265-partition-array-according-to-given-pivot
2320-find-all-k-distant-indices-in-an-array
2497-maximum-matching-of-players-with-trainers
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

0594-longest-harmonious-subsequence
1460-number-of-substrings-containing-all-three-characters
1813-maximum-erasure-value
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
3743-reschedule-meetings-for-maximum-free-time-i

Binary Search

1335-maximum-candies-allocated-to-k-children
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
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
2400-minimum-score-after-removals-on-a-tree
2478-longest-nice-subarray
3348-minimum-cost-walk-in-weighted-graph
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3600-find-the-k-th-character-in-string-game-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)

1478-maximum-number-of-events-that-can-be-attended
2267-minimum-difference-in-sums-after-removal-of-elements
2479-meeting-rooms-iii
2681-put-marbles-in-bags

Enumeration

2140-longest-subsequence-repeated-k-times
3741-reschedule-meetings-for-maximum-free-time-ii
3789-maximize-subarrays-after-removing-one-conflicting-pair

Recursion

3600-find-the-k-th-character-in-string-game-i

Memoization

2028-the-earliest-and-latest-rounds-where-players-compete

Linked List

1411-convert-binary-number-in-a-linked-list-to-integer

Trie

1350-remove-sub-folders-from-the-filesystem
2079-delete-duplicate-folders-in-system

Hash Function

2079-delete-duplicate-folders-in-system

Segment Tree

3789-maximize-subarrays-after-removing-one-conflicting-pair