Skip to content

iamarghamallick/LeetCode-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode-Solutions

Auto-Updated with LeetHub

LeetCode Topics

Dynamic Programming

0010-regular-expression-matching
0118-pascals-triangle
0120-triangle
0826-soup-servings
0867-new-21-game
0934-bitwise-ors-of-subarrays
1111-minimum-score-triangulation-of-polygon
1402-count-square-submatrices-with-all-ones
1586-longest-subarray-of-1s-after-deleting-one-element
1628-count-submatrices-with-all-ones
2028-the-earliest-and-latest-rounds-where-players-compete
2267-minimum-difference-in-sums-after-removal-of-elements
2408-number-of-people-aware-of-a-secret
2882-ways-to-express-an-integer-as-sum-of-powers
3437-maximum-total-damage-with-spell-casting
3490-find-the-maximum-length-of-valid-subsequence-i
3491-find-the-maximum-length-of-valid-subsequence-ii
3648-find-the-maximum-number-of-fruits-collected
3733-length-of-longest-v-shaped-diagonal-segment

Memoization

2028-the-earliest-and-latest-rounds-where-players-compete
3733-length-of-longest-v-shaped-diagonal-segment

Array

0011-container-with-most-water
0036-valid-sudoku
0037-sudoku-solver
0047-permutations-ii
0108-convert-sorted-array-to-binary-search-tree
0118-pascals-triangle
0120-triangle
0407-trapping-rain-water-ii
0417-pacific-atlantic-water-flow
0498-diagonal-traverse
0611-valid-triangle-number
0679-24-game
0794-swim-in-rising-water
0830-largest-triangle-area
0934-bitwise-ors-of-subarrays
0940-fruit-into-baskets
1006-vowel-spellchecker
1018-largest-perimeter-triangle
1111-minimum-score-triangulation-of-polygon
1350-remove-sub-folders-from-the-filesystem
1402-count-square-submatrices-with-all-ones
1426-find-n-unique-integers-sum-up-to-zero
1586-longest-subarray-of-1s-after-deleting-one-element
1612-avoid-flood-in-the-city
1628-count-submatrices-with-all-ones
1813-maximum-erasure-value
1834-minimum-number-of-people-to-teach
1917-maximum-average-pass-ratio
2023-design-movie-rental-system
2079-delete-duplicate-folders-in-system
2170-count-number-of-maximum-bitwise-or-subsets
2229-maximum-fruits-harvested-after-at-most-k-steps
2267-minimum-difference-in-sums-after-removal-of-elements
2307-replace-non-coprime-numbers-in-array
2316-count-hills-and-valleys-in-an-array
2324-find-triangular-sum-of-an-array
2392-successful-pairs-of-spells-and-potions
2400-minimum-score-after-removals-on-a-tree
2429-design-a-food-rating-system
2432-number-of-zero-filled-subarrays
2497-maximum-matching-of-players-with-trainers
2498-smallest-subarrays-with-maximum-bitwise-or
2503-longest-subarray-with-maximum-bitwise-and
2529-range-product-queries-of-powers
2689-rearranging-fruits
3242-count-elements-with-maximum-frequency
3251-maximum-area-of-longest-diagonal-rectangle
3277-find-the-number-of-ways-to-place-people-ii
3278-find-the-number-of-ways-to-place-people-i
3383-taking-maximum-energy-from-the-mystic-dungeon
3437-maximum-total-damage-with-spell-casting
3459-find-the-minimum-area-to-cover-all-ones-ii
3461-find-the-minimum-area-to-cover-all-ones-i
3490-find-the-maximum-length-of-valid-subsequence-i
3491-find-the-maximum-length-of-valid-subsequence-ii
3648-find-the-maximum-number-of-fruits-collected
3733-length-of-longest-v-shaped-diagonal-segment
3744-minimum-operations-to-make-array-elements-zero
3748-sort-matrix-by-diagonals
3788-maximum-unique-subarray-sum-after-deletion
3789-maximize-subarrays-after-removing-one-conflicting-pair
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii
3794-find-the-minimum-amount-of-time-to-brew-potions
3797-design-spreadsheet
3827-implement-router

Two Pointers

0011-container-with-most-water
0125-valid-palindrome
0160-intersection-of-two-linked-lists
0165-compare-version-numbers
0344-reverse-string
0611-valid-triangle-number
2392-successful-pairs-of-spells-and-potions
2497-maximum-matching-of-players-with-trainers
3437-maximum-total-damage-with-spell-casting

Greedy

0011-container-with-most-water
0316-remove-duplicate-letters
0611-valid-triangle-number
1018-largest-perimeter-triangle
1448-maximum-69-number
1612-avoid-flood-in-the-city
1818-maximum-score-from-removing-substrings
1834-minimum-number-of-people-to-teach
1917-maximum-average-pass-ratio
2497-maximum-matching-of-players-with-trainers
2689-rearranging-fruits
3788-maximum-unique-subarray-sum-after-deletion

Sorting

0047-permutations-ii
0611-valid-triangle-number
0900-reordered-power-of-2
1018-largest-perimeter-triangle
2392-successful-pairs-of-spells-and-potions
2497-maximum-matching-of-players-with-trainers
2689-rearranging-fruits
2887-sort-vowels-in-a-string
3277-find-the-number-of-ways-to-place-people-ii
3278-find-the-number-of-ways-to-place-people-i
3437-maximum-total-damage-with-spell-casting
3748-sort-matrix-by-diagonals

String

0006-zigzag-conversion
0008-string-to-integer-atoi
0010-regular-expression-matching
0012-integer-to-roman
0125-valid-palindrome
0165-compare-version-numbers
0166-fraction-to-recurring-decimal
0168-excel-sheet-column-title
0171-excel-sheet-column-number
0316-remove-duplicate-letters
0344-reverse-string
1006-vowel-spellchecker
1264-maximum-number-of-words-you-can-type
1302-delete-characters-to-make-fancy-string
1350-remove-sub-folders-from-the-filesystem
1818-maximum-score-from-removing-substrings
2079-delete-duplicate-folders-in-system
2346-largest-3-same-digit-number-in-string
2429-design-a-food-rating-system
2887-sort-vowels-in-a-string
3396-valid-word
3462-vowels-game-in-a-string
3797-design-spreadsheet
3872-find-most-frequent-vowel-and-consonant

Recursion

0010-regular-expression-matching
0206-reverse-linked-list
0231-power-of-two
0326-power-of-three
0342-power-of-four

Linked List

0160-intersection-of-two-linked-lists
0206-reverse-linked-list
1411-convert-binary-number-in-a-linked-list-to-integer

Math

0012-integer-to-roman
0166-fraction-to-recurring-decimal
0168-excel-sheet-column-title
0171-excel-sheet-column-number
0231-power-of-two
0326-power-of-three
0342-power-of-four
0679-24-game
0826-soup-servings
0830-largest-triangle-area
0867-new-21-game
0900-reordered-power-of-2
1018-largest-perimeter-triangle
1048-clumsy-factorial
1411-convert-binary-number-in-a-linked-list-to-integer
1426-find-n-unique-integers-sum-up-to-zero
1440-convert-integer-to-the-sum-of-two-no-zero-integers
1448-maximum-69-number
1642-water-bottles
2307-replace-non-coprime-numbers-in-array
2324-find-triangular-sum-of-an-array
2432-number-of-zero-filled-subarrays
3277-find-the-number-of-ways-to-place-people-ii
3278-find-the-number-of-ways-to-place-people-i
3279-alice-and-bob-playing-flower-game
3336-water-bottles-ii
3462-vowels-game-in-a-string
3744-minimum-operations-to-make-array-elements-zero
3830-find-closest-person

Heap (Priority Queue)

0407-trapping-rain-water-ii
0794-swim-in-rising-water
1612-avoid-flood-in-the-city
1917-maximum-average-pass-ratio
2023-design-movie-rental-system
2267-minimum-difference-in-sums-after-removal-of-elements
2429-design-a-food-rating-system
3678-design-task-manager

Depth-First Search

0110-balanced-binary-tree
0111-minimum-depth-of-binary-tree
0112-path-sum
0144-binary-tree-preorder-traversal
0417-pacific-atlantic-water-flow
0794-swim-in-rising-water
1350-remove-sub-folders-from-the-filesystem
2400-minimum-score-after-removals-on-a-tree

Trie

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

Hash Table

0012-integer-to-roman
0036-valid-sudoku
0037-sudoku-solver
0160-intersection-of-two-linked-lists
0166-fraction-to-recurring-decimal
0900-reordered-power-of-2
0940-fruit-into-baskets
1006-vowel-spellchecker
1264-maximum-number-of-words-you-can-type
1612-avoid-flood-in-the-city
1813-maximum-erasure-value
1834-minimum-number-of-people-to-teach
2023-design-movie-rental-system
2079-delete-duplicate-folders-in-system
2429-design-a-food-rating-system
2689-rearranging-fruits
3242-count-elements-with-maximum-frequency
3437-maximum-total-damage-with-spell-casting
3678-design-task-manager
3788-maximum-unique-subarray-sum-after-deletion
3797-design-spreadsheet
3827-implement-router
3872-find-most-frequent-vowel-and-consonant

Hash Function

2079-delete-duplicate-folders-in-system

Sliding Window

0867-new-21-game
0940-fruit-into-baskets
1586-longest-subarray-of-1s-after-deleting-one-element
1813-maximum-erasure-value
2229-maximum-fruits-harvested-after-at-most-k-steps
2498-smallest-subarrays-with-maximum-bitwise-or

Stack

0144-binary-tree-preorder-traversal
0316-remove-duplicate-letters
1048-clumsy-factorial
1628-count-submatrices-with-all-ones
1818-maximum-score-from-removing-substrings
2307-replace-non-coprime-numbers-in-array

Bit Manipulation

0190-reverse-bits
0231-power-of-two
0342-power-of-four
0934-bitwise-ors-of-subarrays
2170-count-number-of-maximum-bitwise-or-subsets
2400-minimum-score-after-removals-on-a-tree
2498-smallest-subarrays-with-maximum-bitwise-or
2503-longest-subarray-with-maximum-bitwise-and
2529-range-product-queries-of-powers
2837-minimum-operations-to-make-the-integer-zero
3744-minimum-operations-to-make-array-elements-zero

Tree

0108-convert-sorted-array-to-binary-search-tree
0110-balanced-binary-tree
0111-minimum-depth-of-binary-tree
0112-path-sum
0144-binary-tree-preorder-traversal
2400-minimum-score-after-removals-on-a-tree

Segment Tree

3789-maximize-subarrays-after-removing-one-conflicting-pair
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii

Enumeration

0900-reordered-power-of-2
2170-count-number-of-maximum-bitwise-or-subsets
2837-minimum-operations-to-make-the-integer-zero
3277-find-the-number-of-ways-to-place-people-ii
3278-find-the-number-of-ways-to-place-people-i
3459-find-the-minimum-area-to-cover-all-ones-ii
3789-maximize-subarrays-after-removing-one-conflicting-pair

Prefix Sum

2229-maximum-fruits-harvested-after-at-most-k-steps
2529-range-product-queries-of-powers
3383-taking-maximum-energy-from-the-mystic-dungeon
3789-maximize-subarrays-after-removing-one-conflicting-pair
3794-find-the-minimum-amount-of-time-to-brew-potions

Divide and Conquer

0108-convert-sorted-array-to-binary-search-tree
0190-reverse-bits

Binary Search Tree

0108-convert-sorted-array-to-binary-search-tree
0611-valid-triangle-number
0794-swim-in-rising-water
1612-avoid-flood-in-the-city
2229-maximum-fruits-harvested-after-at-most-k-steps
2392-successful-pairs-of-spells-and-potions
2498-smallest-subarrays-with-maximum-bitwise-or
3437-maximum-total-damage-with-spell-casting
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii
3827-implement-router

Binary Tree

0108-convert-sorted-array-to-binary-search-tree
0110-balanced-binary-tree
0111-minimum-depth-of-binary-tree
0112-path-sum
0144-binary-tree-preorder-traversal

Breadth-First Search

0111-minimum-depth-of-binary-tree
0112-path-sum
0407-trapping-rain-water-ii
0417-pacific-atlantic-water-flow
0794-swim-in-rising-water

Backtracking

0037-sudoku-solver
0047-permutations-ii
0679-24-game
2170-count-number-of-maximum-bitwise-or-subsets

Database

0175-combine-two-tables
0176-second-highest-salary
0177-nth-highest-salary
0181-employees-earning-more-than-their-managers
0182-duplicate-emails
0183-customers-who-never-order
0184-department-highest-salary
0196-delete-duplicate-emails
0197-rising-temperature
0570-managers-with-at-least-5-direct-reports
0577-employee-bonus
0584-find-customer-referee
0595-big-countries
1153-product-sales-analysis-i
1258-article-views-i
1415-students-and-examinations
1509-replace-employee-id-with-the-unique-identifier
1724-customer-who-visited-but-did-not-make-any-transactions
1801-average-time-of-process-per-machine
1827-invalid-tweets
1908-recyclable-and-low-fat-products
2087-confirmation-rate

Brainteaser

2503-longest-subarray-with-maximum-bitwise-and
2837-minimum-operations-to-make-the-integer-zero
3462-vowels-game-in-a-string

Simulation

0498-diagonal-traverse
1048-clumsy-factorial
1642-water-bottles
2324-find-triangular-sum-of-an-array
2408-number-of-people-aware-of-a-secret
3336-water-bottles-ii
3790-fruits-into-baskets-ii
3794-find-the-minimum-amount-of-time-to-brew-potions

Ordered Set

2023-design-movie-rental-system
2429-design-a-food-rating-system
3678-design-task-manager
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii
3827-implement-router

Matrix

0036-valid-sudoku
0037-sudoku-solver
0407-trapping-rain-water-ii
0417-pacific-atlantic-water-flow
0498-diagonal-traverse
0794-swim-in-rising-water
1402-count-square-submatrices-with-all-ones
1628-count-submatrices-with-all-ones
3459-find-the-minimum-area-to-cover-all-ones-ii
3461-find-the-minimum-area-to-cover-all-ones-i
3648-find-the-maximum-number-of-fruits-collected
3733-length-of-longest-v-shaped-diagonal-segment
3748-sort-matrix-by-diagonals
3797-design-spreadsheet

Probability and Statistics

0826-soup-servings
0867-new-21-game

Counting

0900-reordered-power-of-2
3242-count-elements-with-maximum-frequency
3437-maximum-total-damage-with-spell-casting
3872-find-most-frequent-vowel-and-consonant

Monotonic Stack

0316-remove-duplicate-letters
1628-count-submatrices-with-all-ones

Geometry

0830-largest-triangle-area
3277-find-the-number-of-ways-to-place-people-ii
3278-find-the-number-of-ways-to-place-people-i

Queue

2408-number-of-people-aware-of-a-secret
3827-implement-router

Game Theory

3462-vowels-game-in-a-string

Number Theory

2307-replace-non-coprime-numbers-in-array

Design

2023-design-movie-rental-system
2429-design-a-food-rating-system
3678-design-task-manager
3797-design-spreadsheet
3827-implement-router

Combinatorics

2324-find-triangular-sum-of-an-array

Union Find

0794-swim-in-rising-water