Skip to content

Rynf0rce/Leetcode-TILs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A collection of LeetCode questions to ace the coding interviews! - Created using LeetHub 2.0 for Firefox

LeetCode Topics

Math

0070-climbing-stairs
0231-power-of-two
0797-rabbits-in-forest
0867-new-21-game
0900-reordered-power-of-2
1421-find-numbers-with-even-number-of-digits
1448-maximum-69-number
1477-product-of-the-last-k-numbers
1500-count-largest-group
1529-max-difference-you-can-get-from-changing-an-integer
1631-number-of-sub-arrays-with-odd-sum
1889-check-if-number-is-a-sum-of-powers-of-three
1993-sum-of-all-subset-xor-totals
2160-minimum-operations-to-make-a-uni-value-grid
2348-count-number-of-texts
2415-count-the-number-of-ideal-arrays
2448-count-number-of-bad-pairs
2649-count-total-number-of-colored-cells
2704-maximum-difference-by-remapping-a-digit
2802-find-the-punishment-number-of-an-integer
2998-count-symmetric-integers
3172-divisible-and-non-divisible-sums-difference
3201-distribute-candies-among-children-ii
3227-find-missing-and-repeated-values
3243-count-the-number-of-powerful-integers
3321-type-of-triangle
3548-find-the-count-of-good-integers
3629-total-characters-in-string-after-transformations-i
3635-smallest-divisible-digit-product-ii
3637-count-number-of-balanced-permutations
3682-count-the-number-of-arrays-with-k-matching-adjacent-elements

Dynamic Programming

0070-climbing-stairs
0416-partition-equal-subset-sum
0806-domino-and-tromino-tiling
0867-new-21-game
0868-push-dominoes
0905-length-of-longest-fibonacci-subsequence
1000-delete-columns-to-make-sorted-iii
1170-shortest-common-supersequence
1290-make-array-strictly-increasing
1586-longest-subarray-of-1s-after-deleting-one-element
1631-number-of-sub-arrays-with-odd-sum
1986-largest-color-value-in-a-directed-graph
2028-the-earliest-and-latest-rounds-where-players-compete
2090-number-of-ways-to-arrive-at-destination
2205-find-good-days-to-rob-the-bank
2262-solving-questions-with-brainpower
2348-count-number-of-texts
2415-count-the-number-of-ideal-arrays
3142-longest-unequal-adjacent-groups-subsequence-ii
3243-count-the-number-of-powerful-integers
3629-total-characters-in-string-after-transformations-i
3637-count-number-of-balanced-permutations
3716-longest-subsequence-with-decreasing-adjacent-difference

Memoization

0070-climbing-stairs
1986-largest-color-value-in-a-directed-graph
2028-the-earliest-and-latest-rounds-where-players-compete

Array

0075-sort-colors
0407-trapping-rain-water-ii
0416-partition-equal-subset-sum
0594-longest-harmonious-subsequence
0658-find-k-closest-elements
0797-rabbits-in-forest
0854-making-a-large-island
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0945-snakes-and-ladders
1000-delete-columns-to-make-sorted-iii
1227-number-of-equivalent-domino-pairs
1290-make-array-strictly-increasing
1293-three-consecutive-odds
1335-maximum-candies-allocated-to-k-children
1350-remove-sub-folders-from-the-filesystem
1364-tuple-with-same-product
1421-find-numbers-with-even-number-of-digits
1424-maximum-candies-you-can-get-from-boxes
1477-product-of-the-last-k-numbers
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1510-find-lucky-integer-in-an-array
1586-longest-subarray-of-1s-after-deleting-one-element
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
1631-number-of-sub-arrays-with-odd-sum
1656-count-good-triplets
1819-construct-the-lexicographically-largest-valid-sequence
1876-map-of-highest-peak
1878-check-if-array-is-sorted-and-rotated
1927-maximum-ascending-subarray-sum
1993-sum-of-all-subset-xor-totals
1995-finding-pairs-with-a-certain-sum
2079-delete-duplicate-folders-in-system
2107-find-unique-binary-string
2145-grid-game
2150-kth-smallest-product-of-two-sorted-arrays
2160-minimum-operations-to-make-a-uni-value-grid
2180-maximum-number-of-tasks-you-can-assign
2204-find-subsequence-of-length-k-with-the-largest-sum
2205-find-good-days-to-rob-the-bank
2215-finding-3-digit-even-numbers
2237-longest-palindrome-by-concatenating-two-letter-words
2249-count-the-hidden-sequences
2262-solving-questions-with-brainpower
2277-count-equal-and-divisible-pairs-in-an-array
2280-count-good-triplets-in-an-array
2316-count-hills-and-valleys-in-an-array
2394-count-subarrays-with-score-less-than-k
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2478-longest-nice-subarray
2497-maximum-matching-of-players-with-trainers
2527-count-subarrays-with-fixed-bounds
2533-bitwise-xor-of-all-pairings
2551-apply-operations-to-an-array
2564-most-profitable-path-in-a-tree
2588-maximum-number-of-points-from-grid-queries
2626-count-the-number-of-good-subarrays
2665-minimum-time-to-repair-cars
2681-put-marbles-in-bags
2685-first-completely-painted-row-or-column
2690-house-robber-iv
2699-count-the-number-of-fair-pairs
2707-merge-two-2d-arrays-by-summing-values
2764-maximum-number-of-fish-in-a-grid
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
2856-count-complete-subarrays-in-an-array
2915-count-of-interesting-subarrays
3142-longest-unequal-adjacent-groups-subsequence-ii
3194-find-words-containing-character
3219-make-lexicographically-smallest-array-by-swapping-elements
3227-find-missing-and-repeated-values
3321-type-of-triangle
3332-minimum-operations-to-exceed-threshold-value-ii
3348-minimum-cost-walk-in-weighted-graph
3372-longest-strictly-increasing-or-strictly-decreasing-subarray
3429-special-array-i
3430-count-days-without-meetings
3434-find-the-number-of-distinct-colors-among-the-balls
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3621-minimum-operations-to-make-array-values-equal-to-k
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii
3643-zero-array-transformation-ii
3656-minimum-number-of-operations-to-make-elements-in-array-distinct
3657-check-if-grid-can-be-cut-into-sections
3685-count-subarrays-of-length-three-with-a-condition
3716-longest-subsequence-with-decreasing-adjacent-difference
3747-maximum-difference-between-adjacent-elements-in-a-circular-array
3789-maximize-subarrays-after-removing-one-conflicting-pair

Hash Table

0594-longest-harmonious-subsequence
0768-partition-labels
0797-rabbits-in-forest
0900-reordered-power-of-2
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1218-lowest-common-ancestor-of-deepest-leaves
1227-number-of-equivalent-domino-pairs
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
1510-find-lucky-integer-in-an-array
1915-check-if-one-string-swap-can-make-strings-equal
1986-largest-color-value-in-a-directed-graph
1995-finding-pairs-with-a-certain-sum
2079-delete-duplicate-folders-in-system
2107-find-unique-binary-string
2204-find-subsequence-of-length-k-with-the-largest-sum
2215-finding-3-digit-even-numbers
2237-longest-palindrome-by-concatenating-two-letter-words
2348-count-number-of-texts
2434-design-a-number-container-system
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2520-using-a-robot-to-print-the-lexicographically-smallest-string
2626-count-the-number-of-good-subarrays
2685-first-completely-painted-row-or-column
2707-merge-two-2d-arrays-by-summing-values
2766-find-the-prefix-common-array-of-two-arrays
2856-count-complete-subarrays-in-an-array
2915-count-of-interesting-subarrays
3227-find-missing-and-repeated-values
3360-minimum-deletions-to-make-string-k-special
3434-find-the-number-of-distinct-colors-among-the-balls
3445-lexicographically-minimum-string-after-removing-stars
3548-find-the-count-of-good-integers
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
3621-minimum-operations-to-make-array-values-equal-to-k
3629-total-characters-in-string-after-transformations-i
3656-minimum-number-of-operations-to-make-elements-in-array-distinct

Bit Manipulation

0231-power-of-two
1993-sum-of-all-subset-xor-totals
2478-longest-nice-subarray
2509-minimize-xor
2533-bitwise-xor-of-all-pairings
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
3348-minimum-cost-walk-in-weighted-graph
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

Greedy

0768-partition-labels
0797-rabbits-in-forest
1448-maximum-69-number
1529-max-difference-you-can-get-from-changing-an-integer
2180-maximum-number-of-tasks-you-can-assign
2237-longest-palindrome-by-concatenating-two-letter-words
2456-construct-smallest-number-from-di-string
2497-maximum-matching-of-players-with-trainers
2509-minimize-xor
2520-using-a-robot-to-print-the-lexicographically-smallest-string
2681-put-marbles-in-bags
2704-maximum-difference-by-remapping-a-digit
3360-minimum-deletions-to-make-string-k-special
3445-lexicographically-minimum-string-after-removing-stars
3635-smallest-divisible-digit-product-ii

Brainteaser

2533-bitwise-xor-of-all-pairings

Breadth-First Search

0297-serialize-and-deserialize-binary-tree
0407-trapping-rain-water-ii
0820-find-eventual-safe-states
0854-making-a-large-island
0945-snakes-and-ladders
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
1424-maximum-candies-you-can-get-from-boxes
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1558-course-schedule-iv
1876-map-of-highest-peak
2564-most-profitable-path-in-a-tree
2583-divide-nodes-into-the-maximum-number-of-groups
2588-maximum-number-of-points-from-grid-queries
2764-maximum-number-of-fish-in-a-grid
2793-count-the-number-of-complete-components
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i

Graph

0820-find-eventual-safe-states
1424-maximum-candies-you-can-get-from-boxes
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1558-course-schedule-iv
1986-largest-color-value-in-a-directed-graph
2090-number-of-ways-to-arrive-at-destination
2246-maximum-employees-to-be-invited-to-a-meeting
2564-most-profitable-path-in-a-tree
2583-divide-nodes-into-the-maximum-number-of-groups
2793-count-the-number-of-complete-components
3348-minimum-cost-walk-in-weighted-graph
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii

Heap (Priority Queue)

0407-trapping-rain-water-ii
0658-find-k-closest-elements
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2204-find-subsequence-of-length-k-with-the-largest-sum
2434-design-a-number-container-system
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2588-maximum-number-of-points-from-grid-queries
2681-put-marbles-in-bags
3332-minimum-operations-to-exceed-threshold-value-ii
3445-lexicographically-minimum-string-after-removing-stars
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii

Matrix

0407-trapping-rain-water-ii
0854-making-a-large-island
0945-snakes-and-ladders
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1876-map-of-highest-peak
2145-grid-game
2160-minimum-operations-to-make-a-uni-value-grid
2588-maximum-number-of-points-from-grid-queries
2685-first-completely-painted-row-or-column
2764-maximum-number-of-fish-in-a-grid
3227-find-missing-and-repeated-values
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii

Shortest Path

1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2090-number-of-ways-to-arrive-at-destination
3627-find-minimum-time-to-reach-last-room-i
3628-find-minimum-time-to-reach-last-room-ii

String

0297-serialize-and-deserialize-binary-tree
0768-partition-labels
0868-push-dominoes
1000-delete-columns-to-make-sorted-iii
1058-lexicographically-smallest-equivalent-string
1093-recover-a-tree-from-preorder-traversal
1170-shortest-common-supersequence
1350-remove-sub-folders-from-the-filesystem
1460-number-of-substrings-containing-all-three-characters
1915-check-if-one-string-swap-can-make-strings-equal
2021-remove-all-occurrences-of-a-substring
2079-delete-duplicate-folders-in-system
2107-find-unique-binary-string
2237-longest-palindrome-by-concatenating-two-letter-words
2260-divide-a-string-into-groups-of-size-k
2348-count-number-of-texts
2456-construct-smallest-number-from-di-string
2463-minimum-recolors-to-get-k-consecutive-black-blocks
2520-using-a-robot-to-print-the-lexicographically-smallest-string
3142-longest-unequal-adjacent-groups-subsequence-ii
3194-find-words-containing-character
3243-count-the-number-of-powerful-integers
3360-minimum-deletions-to-make-string-k-special
3445-lexicographically-minimum-string-after-removing-stars
3447-clear-digits
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
3629-total-characters-in-string-after-transformations-i
3635-smallest-divisible-digit-product-ii
3637-count-number-of-balanced-permutations

Backtracking

1819-construct-the-lexicographically-largest-valid-sequence
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
3635-smallest-divisible-digit-product-ii

Number Theory

2415-count-the-number-of-ideal-arrays
3635-smallest-divisible-digit-product-ii

Prefix Sum

1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
2145-grid-game
2205-find-good-days-to-rob-the-bank
2249-count-the-hidden-sequences
2394-count-subarrays-with-score-less-than-k
2915-count-of-interesting-subarrays
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

Depth-First Search

0297-serialize-and-deserialize-binary-tree
0386-lexicographical-numbers
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
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting
2564-most-profitable-path-in-a-tree
2764-maximum-number-of-fish-in-a-grid
2793-count-the-number-of-complete-components
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i

Topological Sort

0820-find-eventual-safe-states
1558-course-schedule-iv
1986-largest-color-value-in-a-directed-graph
2090-number-of-ways-to-arrive-at-destination
2246-maximum-employees-to-be-invited-to-a-meeting

Union Find

0854-making-a-large-island
1058-lexicographically-smallest-equivalent-string
2583-divide-nodes-into-the-maximum-number-of-groups
2588-maximum-number-of-points-from-grid-queries
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

Sorting

0075-sort-colors
0594-longest-harmonious-subsequence
0658-find-k-closest-elements
0900-reordered-power-of-2
1290-make-array-strictly-increasing
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
2160-minimum-operations-to-make-a-uni-value-grid
2180-maximum-number-of-tasks-you-can-assign
2204-find-subsequence-of-length-k-with-the-largest-sum
2215-finding-3-digit-even-numbers
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2497-maximum-matching-of-players-with-trainers
2588-maximum-number-of-points-from-grid-queries
2681-put-marbles-in-bags
2699-count-the-number-of-fair-pairs
3219-make-lexicographically-smallest-array-by-swapping-elements
3321-type-of-triangle
3360-minimum-deletions-to-make-string-k-special
3430-count-days-without-meetings
3657-check-if-grid-can-be-cut-into-sections

Design

0297-serialize-and-deserialize-binary-tree
1387-find-elements-in-a-contaminated-binary-tree
1477-product-of-the-last-k-numbers
1995-finding-pairs-with-a-certain-sum
2434-design-a-number-container-system

Ordered Set

2280-count-good-triplets-in-an-array
2434-design-a-number-container-system

Simulation

2021-remove-all-occurrences-of-a-substring
2260-divide-a-string-into-groups-of-size-k
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

Counting

0594-longest-harmonious-subsequence
0900-reordered-power-of-2
1227-number-of-equivalent-domino-pairs
1364-tuple-with-same-product
1510-find-lucky-integer-in-an-array
1915-check-if-one-string-swap-can-make-strings-equal
1986-largest-color-value-in-a-directed-graph
2237-longest-palindrome-by-concatenating-two-letter-words
2448-count-number-of-bad-pairs
3360-minimum-deletions-to-make-string-k-special
3629-total-characters-in-string-after-transformations-i

Stack

2021-remove-all-occurrences-of-a-substring
2456-construct-smallest-number-from-di-string
2520-using-a-robot-to-print-the-lexicographically-smallest-string
3445-lexicographically-minimum-string-after-removing-stars
3447-clear-digits

Data Stream

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

Tree

0297-serialize-and-deserialize-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
2564-most-profitable-path-in-a-tree
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i

Binary Tree

0297-serialize-and-deserialize-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
2280-count-good-triplets-in-an-array

Two Pointers

0075-sort-colors
0658-find-k-closest-elements
0768-partition-labels
0868-push-dominoes
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
2497-maximum-matching-of-players-with-trainers
2551-apply-operations-to-an-array
2588-maximum-number-of-points-from-grid-queries
2699-count-the-number-of-fair-pairs
2707-merge-two-2d-arrays-by-summing-values

Binary Search

0658-find-k-closest-elements
1290-make-array-strictly-increasing
1335-maximum-candies-allocated-to-k-children
1621-number-of-subsequences-that-satisfy-the-given-sum-condition
2150-kth-smallest-product-of-two-sorted-arrays
2180-maximum-number-of-tasks-you-can-assign
2280-count-good-triplets-in-an-array
2394-count-subarrays-with-score-less-than-k
2665-minimum-time-to-repair-cars
2690-house-robber-iv
2699-count-the-number-of-fair-pairs
3643-zero-array-transformation-ii

Sliding Window

0594-longest-harmonious-subsequence
0658-find-k-closest-elements
0867-new-21-game
1460-number-of-substrings-containing-all-three-characters
1586-longest-subarray-of-1s-after-deleting-one-element
2394-count-subarrays-with-score-less-than-k
2463-minimum-recolors-to-get-k-consecutive-black-blocks
2478-longest-nice-subarray
2527-count-subarrays-with-fixed-bounds
2626-count-the-number-of-good-subarrays
2856-count-complete-subarrays-in-an-array
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii

Queue

2180-maximum-number-of-tasks-you-can-assign
2527-count-subarrays-with-fixed-bounds
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

Combinatorics

1993-sum-of-all-subset-xor-totals
2415-count-the-number-of-ideal-arrays
3201-distribute-candies-among-children-ii
3548-find-the-count-of-good-integers
3637-count-number-of-balanced-permutations
3682-count-the-number-of-arrays-with-k-matching-adjacent-elements

Enumeration

0900-reordered-power-of-2
1656-count-good-triplets
1993-sum-of-all-subset-xor-totals
2215-finding-3-digit-even-numbers
2998-count-symmetric-integers
3201-distribute-candies-among-children-ii
3548-find-the-count-of-good-integers
3789-maximize-subarrays-after-removing-one-conflicting-pair

Binary Indexed Tree

2280-count-good-triplets-in-an-array

Segment Tree

2280-count-good-triplets-in-an-array
3789-maximize-subarrays-after-removing-one-conflicting-pair

Merge Sort

2280-count-good-triplets-in-an-array

Monotonic Queue

2180-maximum-number-of-tasks-you-can-assign
2527-count-subarrays-with-fixed-bounds

Trie

0386-lexicographical-numbers
0440-k-th-smallest-in-lexicographical-order
1350-remove-sub-folders-from-the-filesystem
2079-delete-duplicate-folders-in-system

Hash Function

2079-delete-duplicate-folders-in-system

Recursion

0231-power-of-two

Probability and Statistics

0867-new-21-game

About

TILs for Leetcode(https://www.Leetcode.com)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages