Skip to content

This repo contains all the problems I pricticed from the leetcode for the interview preparations conatins most of problems from the https://neetcode.io/roadmap, https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/ and Blind-75.

Notifications You must be signed in to change notification settings

vatsal30/LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode

This repo contains all the problems I pricticed from the leetcode for the interview preparations conatins most of problems from the https://neetcode.io/roadmap, https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/ and Blind-75.

This repo has been updated using chrome extension LeetHub-2.0 and LeetHub to auto commit the problems once I solved them on leetcode.

LeetCode Topics

Stack

0042-trapping-rain-water
0150-evaluate-reverse-polish-notation
0155-min-stack
0678-valid-parenthesis-string
0739-daily-temperatures
0780-max-chunks-to-make-sorted
1371-minimum-remove-to-make-valid-parentheses
1570-final-prices-with-a-special-discount-in-a-shop
2221-check-if-a-parentheses-string-can-be-valid
3181-find-building-where-alice-and-bob-can-meet

Design

0155-min-stack
0208-implement-trie-prefix-tree
0380-insert-delete-getrandom-o1
2429-design-a-food-rating-system
2434-design-a-number-container-system
3678-design-task-manager

Array

0001-two-sum
0011-container-with-most-water
0015-3sum
0018-4sum
0027-remove-element
0036-valid-sudoku
0042-trapping-rain-water
0063-unique-paths-ii
0064-minimum-path-sum
0066-plus-one
0088-merge-sorted-array
0118-pascals-triangle
0119-pascals-triangle-ii
0136-single-number
0139-word-break
0150-evaluate-reverse-polish-notation
0167-two-sum-ii-input-array-is-sorted
0198-house-robber
0213-house-robber-ii
0238-product-of-array-except-self
0268-missing-number
0283-move-zeroes
0380-insert-delete-getrandom-o1
0407-trapping-rain-water-ii
0494-target-sum
0542-01-matrix
0689-maximum-sum-of-3-non-overlapping-subarrays
0739-daily-temperatures
0780-max-chunks-to-make-sorted
0854-making-a-large-island
1025-minimum-cost-for-tickets
1063-best-sightseeing-pair
1217-relative-sort-array
1364-tuple-with-same-product
1396-count-servers-that-communicate
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1524-string-matching-in-an-array
1570-final-prices-with-a-special-discount-in-a-shop
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1876-map-of-highest-peak
1878-check-if-array-is-sorted-and-rotated
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1927-maximum-ascending-subarray-sum
2145-grid-game
2292-counting-words-with-a-given-prefix
2358-number-of-ways-to-split-array
2392-successful-pairs-of-spells-and-potions
2465-shifting-letters-ii
2533-bitwise-xor-of-all-pairings
2586-longest-square-streak-in-an-array
2685-first-completely-painted-row-or-column
2764-maximum-number-of-fish-in-a-grid
2766-find-the-prefix-common-array-of-two-arrays
2791-find-the-losers-of-the-circular-game
2792-neighboring-bitwise-xor
3181-find-building-where-alice-and-bob-can-meet
3219-make-lexicographically-smallest-array-by-swapping-elements
3309-count-prefix-and-suffix-pairs-i
3372-longest-strictly-increasing-or-strictly-decreasing-subarray
3429-special-array-i
3434-find-the-number-of-distinct-colors-among-the-balls

Math

0002-add-two-numbers
0062-unique-paths
0066-plus-one
0070-climbing-stairs
0150-evaluate-reverse-polish-notation
0268-missing-number
0371-sum-of-two-integers
0380-insert-delete-getrandom-o1
1146-greatest-common-divisor-of-strings
1642-water-bottles
2812-find-the-maximum-achievable-number

Monotonic Stack

0042-trapping-rain-water
0739-daily-temperatures
0780-max-chunks-to-make-sorted
1570-final-prices-with-a-special-discount-in-a-shop
3181-find-building-where-alice-and-bob-can-meet

Greedy

0011-container-with-most-water
0678-valid-parenthesis-string
0780-max-chunks-to-make-sorted
1502-construct-k-palindrome-strings
2221-check-if-a-parentheses-string-can-be-valid
2509-minimize-xor

Sorting

0015-3sum
0018-4sum
0088-merge-sorted-array
0242-valid-anagram
0268-missing-number
0389-find-the-difference
0780-max-chunks-to-make-sorted
1217-relative-sort-array
2392-successful-pairs-of-spells-and-potions
2586-longest-square-streak-in-an-array
3219-make-lexicographically-smallest-array-by-swapping-elements

Tree

0124-binary-tree-maximum-path-sum
0337-house-robber-iii
0404-sum-of-left-leaves
0515-find-largest-value-in-each-tree-row
0653-two-sum-iv-input-is-a-bst
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
3058-maximum-number-of-k-divisible-components
3439-find-minimum-diameter-after-merging-two-trees

Depth-First Search

0124-binary-tree-maximum-path-sum
0207-course-schedule
0210-course-schedule-ii
0337-house-robber-iii
0404-sum-of-left-leaves
0515-find-largest-value-in-each-tree-row
0653-two-sum-iv-input-is-a-bst
0684-redundant-connection
0801-is-graph-bipartite
0820-find-eventual-safe-states
0854-making-a-large-island
1396-count-servers-that-communicate
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting
2493-reverse-odd-levels-of-binary-tree
2764-maximum-number-of-fish-in-a-grid
3058-maximum-number-of-k-divisible-components
3439-find-minimum-diameter-after-merging-two-trees

Breadth-First Search

0207-course-schedule
0210-course-schedule-ii
0404-sum-of-left-leaves
0407-trapping-rain-water-ii
0515-find-largest-value-in-each-tree-row
0542-01-matrix
0653-two-sum-iv-input-is-a-bst
0684-redundant-connection
0801-is-graph-bipartite
0820-find-eventual-safe-states
0854-making-a-large-island
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
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
2583-divide-nodes-into-the-maximum-number-of-groups
2764-maximum-number-of-fish-in-a-grid
3439-find-minimum-diameter-after-merging-two-trees

Binary Tree

0124-binary-tree-maximum-path-sum
0337-house-robber-iii
0404-sum-of-left-leaves
0515-find-largest-value-in-each-tree-row
0653-two-sum-iv-input-is-a-bst
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level

Two Pointers

0011-container-with-most-water
0015-3sum
0018-4sum
0027-remove-element
0028-find-the-index-of-the-first-occurrence-in-a-string
0042-trapping-rain-water
0088-merge-sorted-array
0167-two-sum-ii-input-array-is-sorted
0283-move-zeroes
0653-two-sum-iv-input-is-a-bst
1894-merge-strings-alternately
2392-successful-pairs-of-spells-and-potions

String

0022-generate-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0139-word-break
0208-implement-trie-prefix-tree
0242-valid-anagram
0389-find-the-difference
0459-repeated-substring-pattern
0678-valid-parenthesis-string
1146-greatest-common-divisor-of-strings
1371-minimum-remove-to-make-valid-parentheses
1469-minimum-number-of-steps-to-make-two-strings-anagram
1502-construct-k-palindrome-strings
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1894-merge-strings-alternately
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1915-check-if-one-string-swap-can-make-strings-equal
2059-unique-length-3-palindromic-subsequences
2221-check-if-a-parentheses-string-can-be-valid
2292-counting-words-with-a-given-prefix
2465-shifting-letters-ii
3309-count-prefix-and-suffix-pairs-i
3455-minimum-length-of-string-after-operations

Hash Table

0001-two-sum
0036-valid-sudoku
0139-word-break
0208-implement-trie-prefix-tree
0242-valid-anagram
0268-missing-number
0380-insert-delete-getrandom-o1
0389-find-the-difference
0653-two-sum-iv-input-is-a-bst
1217-relative-sort-array
1364-tuple-with-same-product
1469-minimum-number-of-steps-to-make-two-strings-anagram
1502-construct-k-palindrome-strings
1915-check-if-one-string-swap-can-make-strings-equal
2059-unique-length-3-palindromic-subsequences
2429-design-a-food-rating-system
2434-design-a-number-container-system
2586-longest-square-streak-in-an-array
2685-first-completely-painted-row-or-column
2766-find-the-prefix-common-array-of-two-arrays
2791-find-the-losers-of-the-circular-game
3434-find-the-number-of-distinct-colors-among-the-balls
3455-minimum-length-of-string-after-operations
3678-design-task-manager

Bit Manipulation

0136-single-number
0190-reverse-bits
0191-number-of-1-bits
0268-missing-number
0338-counting-bits
0371-sum-of-two-integers
0389-find-the-difference
2059-unique-length-3-palindromic-subsequences
2509-minimize-xor
2533-bitwise-xor-of-all-pairings
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
0459-repeated-substring-pattern
1524-string-matching-in-an-array
2292-counting-words-with-a-given-prefix
3309-count-prefix-and-suffix-pairs-i

Binary Search

0167-two-sum-ii-input-array-is-sorted
0268-missing-number
2392-successful-pairs-of-spells-and-potions
2586-longest-square-streak-in-an-array
3181-find-building-where-alice-and-bob-can-meet

Binary Indexed Tree

3181-find-building-where-alice-and-bob-can-meet

Segment Tree

3181-find-building-where-alice-and-bob-can-meet

Heap (Priority Queue)

0407-trapping-rain-water-ii
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2429-design-a-food-rating-system
2434-design-a-number-container-system
3181-find-building-where-alice-and-bob-can-meet
3678-design-task-manager

Graph

0207-course-schedule
0210-course-schedule-ii
0684-redundant-connection
0801-is-graph-bipartite
0820-find-eventual-safe-states
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting
2583-divide-nodes-into-the-maximum-number-of-groups
3439-find-minimum-diameter-after-merging-two-trees

Dynamic Programming

0022-generate-parentheses
0042-trapping-rain-water
0062-unique-paths
0063-unique-paths-ii
0064-minimum-path-sum
0070-climbing-stairs
0118-pascals-triangle
0119-pascals-triangle-ii
0124-binary-tree-maximum-path-sum
0139-word-break
0198-house-robber
0213-house-robber-ii
0337-house-robber-iii
0338-counting-bits
0494-target-sum
0542-01-matrix
0678-valid-parenthesis-string
0689-maximum-sum-of-3-non-overlapping-subarrays
1025-minimum-cost-for-tickets
1063-best-sightseeing-pair
1263-number-of-dice-rolls-with-target-sum
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
2562-count-ways-to-build-good-strings
2586-longest-square-streak-in-an-array

Backtracking

0022-generate-parentheses
0494-target-sum

Memoization

0070-climbing-stairs
0139-word-break

Prefix Sum

0238-product-of-array-except-self
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
2358-number-of-ways-to-split-array
2465-shifting-letters-ii

Ordered Set

2429-design-a-food-rating-system
2434-design-a-number-container-system
3678-design-task-manager

Combinatorics

0062-unique-paths

Linked List

0002-add-two-numbers

Recursion

0002-add-two-numbers

Trie

0139-word-break
0208-implement-trie-prefix-tree
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

Simulation

1642-water-bottles
2791-find-the-losers-of-the-circular-game
3434-find-the-number-of-distinct-colors-among-the-balls

Matrix

0036-valid-sudoku
0063-unique-paths-ii
0064-minimum-path-sum
0407-trapping-rain-water-ii
0542-01-matrix
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
2685-first-completely-painted-row-or-column
2764-maximum-number-of-fish-in-a-grid

Counting

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

Brainteaser

2533-bitwise-xor-of-all-pairings

Divide and Conquer

0190-reverse-bits
0191-number-of-1-bits

Shortest Path

1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid

Union Find

0684-redundant-connection
0801-is-graph-bipartite
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

0207-course-schedule
0210-course-schedule-ii
0820-find-eventual-safe-states
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting

Counting Sort

1217-relative-sort-array

Binary Search Tree

0653-two-sum-iv-input-is-a-bst

Randomized

0380-insert-delete-getrandom-o1

About

This repo contains all the problems I pricticed from the leetcode for the interview preparations conatins most of problems from the https://neetcode.io/roadmap, https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/ and Blind-75.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published