Skip to content

hazzemSaid/leet-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solve daily challenges code in leetcode everyday

my profile in leet code https://leetcode.com/haazemsaidd/

LeetCode Topics

Two Pointers

0768-partition-labels
2265-partition-array-according-to-given-pivot
2497-maximum-matching-of-players-with-trainers
3018-make-string-a-subsequence-using-cyclic-increments

String

0038-count-and-say
0166-fraction-to-recurring-decimal
0640-solve-the-equation
0768-partition-labels
0952-word-subsets
1502-construct-k-palindrome-strings
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1818-maximum-score-from-removing-substrings
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1915-check-if-one-string-swap-can-make-strings-equal
2021-remove-all-occurrences-of-a-substring
2059-unique-length-3-palindromic-subsequences
2107-find-unique-binary-string
2220-find-all-possible-recipes-from-given-supplies
2221-check-if-a-parentheses-string-can-be-valid
2292-counting-words-with-a-given-prefix
2456-construct-smallest-number-from-di-string
2465-shifting-letters-ii
2691-count-vowel-strings-in-ranges
3018-make-string-a-subsequence-using-cyclic-increments
3309-count-prefix-and-suffix-pairs-i
3447-clear-digits
3455-minimum-length-of-string-after-operations
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii

Prefix Sum

1477-product-of-the-last-k-numbers
1537-maximum-score-after-splitting-a-string
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2059-unique-length-3-palindromic-subsequences
2145-grid-game
2229-maximum-fruits-harvested-after-at-most-k-steps
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
2529-range-product-queries-of-powers
2691-count-vowel-strings-in-ranges
3640-maximum-frequency-of-an-element-after-performing-operations-ii
3643-zero-array-transformation-ii
3794-find-the-minimum-amount-of-time-to-brew-potions

Array

0118-pascals-triangle
0407-trapping-rain-water-ii
0759-set-intersection-size-at-least-two
0854-making-a-large-island
0940-fruit-into-baskets
0952-word-subsets
1335-maximum-candies-allocated-to-k-children
1364-tuple-with-same-product
1396-count-servers-that-communicate
1477-product-of-the-last-k-numbers
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1524-string-matching-in-an-array
1819-construct-the-lexicographically-largest-valid-sequence
1876-map-of-highest-peak
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1917-maximum-average-pass-ratio
1927-maximum-ascending-subarray-sum
2107-find-unique-binary-string
2141-maximum-running-time-of-n-computers
2145-grid-game
2220-find-all-possible-recipes-from-given-supplies
2229-maximum-fruits-harvested-after-at-most-k-steps
2265-partition-array-according-to-given-pivot
2274-keep-multiplying-found-values-by-two
2292-counting-words-with-a-given-prefix
2316-count-hills-and-valleys-in-an-array
2358-number-of-ways-to-split-array
2435-paths-in-matrix-whose-sum-is-divisible-by-k
2448-count-number-of-bad-pairs
2465-shifting-letters-ii
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2478-longest-nice-subarray
2497-maximum-matching-of-players-with-trainers
2498-smallest-subarrays-with-maximum-bitwise-or
2529-range-product-queries-of-powers
2533-bitwise-xor-of-all-pairings
2685-first-completely-painted-row-or-column
2689-rearranging-fruits
2691-count-vowel-strings-in-ranges
2764-maximum-number-of-fish-in-a-grid
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
3152-maximum-value-of-an-ordered-triplet-ii
3219-make-lexicographically-smallest-array-by-swapping-elements
3278-find-the-number-of-ways-to-place-people-i
3309-count-prefix-and-suffix-pairs-i
3372-longest-strictly-increasing-or-strictly-decreasing-subarray
3429-special-array-i
3430-count-days-without-meetings
3640-maximum-frequency-of-an-element-after-performing-operations-ii
3643-zero-array-transformation-ii
3656-minimum-number-of-operations-to-make-elements-in-array-distinct
3790-fruits-into-baskets-ii
3794-find-the-minimum-amount-of-time-to-brew-potions

Hash Table

0166-fraction-to-recurring-decimal
0768-partition-labels
0940-fruit-into-baskets
0952-word-subsets
1218-lowest-common-ancestor-of-deepest-leaves
1364-tuple-with-same-product
1502-construct-k-palindrome-strings
1915-check-if-one-string-swap-can-make-strings-equal
2059-unique-length-3-palindromic-subsequences
2107-find-unique-binary-string
2220-find-all-possible-recipes-from-given-supplies
2274-keep-multiplying-found-values-by-two
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2685-first-completely-painted-row-or-column
2689-rearranging-fruits
2766-find-the-prefix-common-array-of-two-arrays
3455-minimum-length-of-string-after-operations
3548-find-the-count-of-good-integers
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
3656-minimum-number-of-operations-to-make-elements-in-array-distinct
3678-design-task-manager

Bit Manipulation

0231-power-of-two
2059-unique-length-3-palindromic-subsequences
2478-longest-nice-subarray
2498-smallest-subarrays-with-maximum-bitwise-or
2509-minimize-xor
2529-range-product-queries-of-powers
2533-bitwise-xor-of-all-pairings
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor

String Matching

1524-string-matching-in-an-array
2292-counting-words-with-a-given-prefix
3309-count-prefix-and-suffix-pairs-i

Trie

3309-count-prefix-and-suffix-pairs-i

Rolling Hash

3309-count-prefix-and-suffix-pairs-i

Hash Function

3309-count-prefix-and-suffix-pairs-i

Greedy

0759-set-intersection-size-at-least-two
0768-partition-labels
1502-construct-k-palindrome-strings
1818-maximum-score-from-removing-substrings
1917-maximum-average-pass-ratio
2141-maximum-running-time-of-n-computers
2221-check-if-a-parentheses-string-can-be-valid
2456-construct-smallest-number-from-di-string
2497-maximum-matching-of-players-with-trainers
2509-minimize-xor
2689-rearranging-fruits

Counting

1364-tuple-with-same-product
1396-count-servers-that-communicate
1502-construct-k-palindrome-strings
1915-check-if-one-string-swap-can-make-strings-equal
2448-count-number-of-bad-pairs
3455-minimum-length-of-string-after-operations

Stack

1818-maximum-score-from-removing-substrings
2021-remove-all-occurrences-of-a-substring
2221-check-if-a-parentheses-string-can-be-valid
2456-construct-smallest-number-from-di-string
3447-clear-digits

Brainteaser

2533-bitwise-xor-of-all-pairings

Breadth-First Search

0407-trapping-rain-water-ii
0684-redundant-connection
0820-find-eventual-safe-states
0854-making-a-large-island
1218-lowest-common-ancestor-of-deepest-leaves
1396-count-servers-that-communicate
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1558-course-schedule-iv
1876-map-of-highest-peak
2583-divide-nodes-into-the-maximum-number-of-groups
2764-maximum-number-of-fish-in-a-grid

Graph

0684-redundant-connection
0820-find-eventual-safe-states
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
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

Heap (Priority Queue)

0407-trapping-rain-water-ii
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1917-maximum-average-pass-ratio
2473-max-sum-of-a-pair-with-equal-sum-of-digits
3678-design-task-manager

Matrix

0407-trapping-rain-water-ii
0854-making-a-large-island
1396-count-servers-that-communicate
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1876-map-of-highest-peak
2145-grid-game
2435-paths-in-matrix-whose-sum-is-divisible-by-k
2685-first-completely-painted-row-or-column
2764-maximum-number-of-fish-in-a-grid

Shortest Path

1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2090-number-of-ways-to-arrive-at-destination

Depth-First Search

0684-redundant-connection
0820-find-eventual-safe-states
0854-making-a-large-island
1218-lowest-common-ancestor-of-deepest-leaves
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

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
3219-make-lexicographically-smallest-array-by-swapping-elements

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

0759-set-intersection-size-at-least-two
2141-maximum-running-time-of-n-computers
2274-keep-multiplying-found-values-by-two
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2497-maximum-matching-of-players-with-trainers
2689-rearranging-fruits
3219-make-lexicographically-smallest-array-by-swapping-elements
3278-find-the-number-of-ways-to-place-people-i
3430-count-days-without-meetings
3640-maximum-frequency-of-an-element-after-performing-operations-ii

Math

0166-fraction-to-recurring-decimal
0231-power-of-two
0640-solve-the-equation
1477-product-of-the-last-k-numbers
2050-count-good-numbers
2448-count-number-of-bad-pairs
2610-closest-prime-numbers-in-range
3278-find-the-number-of-ways-to-place-people-i
3548-find-the-count-of-good-integers

Simulation

0640-solve-the-equation
2021-remove-all-occurrences-of-a-substring
2265-partition-array-according-to-given-pivot
2274-keep-multiplying-found-values-by-two
3447-clear-digits
3790-fruits-into-baskets-ii
3794-find-the-minimum-amount-of-time-to-brew-potions

Design

1477-product-of-the-last-k-numbers
3678-design-task-manager

Data Stream

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

Backtracking

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

Number Theory

2610-closest-prime-numbers-in-range

Sliding Window

0940-fruit-into-baskets
2229-maximum-fruits-harvested-after-at-most-k-steps
2478-longest-nice-subarray
2498-smallest-subarrays-with-maximum-bitwise-or
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
3640-maximum-frequency-of-an-element-after-performing-operations-ii

Binary Search

1335-maximum-candies-allocated-to-k-children
2141-maximum-running-time-of-n-computers
2229-maximum-fruits-harvested-after-at-most-k-steps
2498-smallest-subarrays-with-maximum-bitwise-or
3640-maximum-frequency-of-an-element-after-performing-operations-ii
3643-zero-array-transformation-ii
3790-fruits-into-baskets-ii

Dynamic Programming

0118-pascals-triangle
2090-number-of-ways-to-arrive-at-destination
2435-paths-in-matrix-whose-sum-is-divisible-by-k

Tree

1218-lowest-common-ancestor-of-deepest-leaves

Binary Tree

1218-lowest-common-ancestor-of-deepest-leaves

Combinatorics

3548-find-the-count-of-good-integers

Enumeration

3278-find-the-number-of-ways-to-place-people-i
3548-find-the-count-of-good-integers

Recursion

0231-power-of-two
2050-count-good-numbers

Segment Tree

3790-fruits-into-baskets-ii

Ordered Set

3678-design-task-manager
3790-fruits-into-baskets-ii

Database

0175-combine-two-tables
0197-rising-temperature
0550-game-play-analysis-iv
0570-managers-with-at-least-5-direct-reports
0577-employee-bonus
0596-classes-with-at-least-5-students
0619-biggest-single-number
0620-not-boring-movies
1045-customers-who-bought-all-products
1070-product-sales-analysis-iii
1075-project-employees-i
1141-user-activity-for-the-past-30-days-i
1174-immediate-food-delivery-ii
1193-monthly-transactions-i
1211-queries-quality-and-percentage
1251-average-selling-price
1280-students-and-examinations
1581-customer-who-visited-but-did-not-make-any-transactions
1633-percentage-of-users-attended-a-contest
1661-average-time-of-process-per-machine
1729-find-followers-count
1731-the-number-of-employees-which-report-to-each-employee
1934-confirmation-rate
2356-number-of-unique-subjects-taught-by-each-teacher

Geometry

3278-find-the-number-of-ways-to-place-people-i

About

Collection of LeetCode questions to ace the coding interview!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published