Skip to content

Pranjal340/Leet-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

859 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A collection of LeetCode questions to ace the coding interview! - Created using LeetHub v2

LeetCode Topics

Array

0016-3sum-closest
0027-remove-element
0041-first-missing-positive
0049-group-anagrams
0056-merge-intervals
0075-sort-colors
0189-rotate-array
0238-product-of-array-except-self
0274-h-index
0350-intersection-of-two-arrays-ii
0368-largest-divisible-subset
0452-minimum-number-of-arrows-to-burst-balloons
0485-max-consecutive-ones
0621-task-scheduler
0624-maximum-distance-in-arrays
0632-smallest-range-covering-elements-from-k-lists
0870-magic-squares-in-grid
0921-spiral-matrix-iii
0948-sort-an-array
0954-maximum-sum-circular-subarray
0999-regions-cut-by-slashes
1002-maximum-width-ramp
1196-filling-bookcase-shelves
1207-delete-nodes-and-return-forest
1240-stone-game-ii
1256-rank-transform-of-an-array
1293-three-consecutive-odds
1333-sort-the-jumbled-numbers
1350-remove-sub-folders-from-the-filesystem
1376-selling-pieces-of-wood
1402-count-square-submatrices-with-all-ones
1511-count-number-of-teams
1556-make-two-arrays-equal-by-reversing-subarrays
1615-range-sum-of-sorted-subarray-sums
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1620-check-if-array-pairs-are-divisible-by-k
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1691-minimum-number-of-days-to-disconnect-island
1694-make-sum-divisible-by-p
1711-find-valid-matrix-given-row-and-column-sums
1720-crawler-log-folder
1741-sort-array-by-increasing-frequency
1762-furthest-building-you-can-reach
1766-minimum-number-of-removals-to-make-mountain-array
1803-average-waiting-time
1878-check-if-array-is-sorted-and-rotated
1923-sentence-similarity-iii
1951-find-the-winner-of-the-circular-game
2054-the-number-of-the-smallest-unoccupied-chair
2067-maximum-number-of-points-with-cost
2163-kth-distinct-string-in-an-array
2170-count-number-of-maximum-bitwise-or-subsets
2179-most-beautiful-item-for-each-query
2255-minimum-swaps-to-group-all-1s-together-ii
2292-counting-words-with-a-given-prefix
2306-create-binary-tree-from-descriptions
2358-number-of-ways-to-split-array
2472-build-a-matrix-with-conditions
2488-divide-intervals-into-minimum-number-of-groups
2502-sort-the-people
2545-height-of-binary-tree-after-subtree-removal-queries
2581-divide-players-into-teams-of-equal-skill
2586-longest-square-streak-in-an-array
2616-maximal-score-after-applying-k-operations
2695-find-score-of-an-array-after-marking-all-elements
2727-number-of-senior-citizens
2794-maximum-number-of-moves-in-a-grid
2846-robot-collisions
3235-minimum-cost-to-convert-string-i
3291-find-if-array-can-be-sorted
3380-shortest-subarray-with-or-at-least-k-ii
3522-find-the-power-of-k-size-subarrays-i

Two Pointers

0016-3sum-closest
0027-remove-element
0028-find-the-index-of-the-first-occurrence-in-a-string
0075-sort-colors
0143-reorder-list
0189-rotate-array
0350-intersection-of-two-arrays-ii
1615-range-sum-of-sorted-subarray-sums
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1923-sentence-similarity-iii
2414-move-pieces-to-obtain-a-string
2488-divide-intervals-into-minimum-number-of-groups
2581-divide-players-into-teams-of-equal-skill
3195-separate-black-and-white-balls

Sorting

0016-3sum-closest
0049-group-anagrams
0056-merge-intervals
0075-sort-colors
0242-valid-anagram
0274-h-index
0350-intersection-of-two-arrays-ii
0368-largest-divisible-subset
0451-sort-characters-by-frequency
0452-minimum-number-of-arrows-to-burst-balloons
0621-task-scheduler
0632-smallest-range-covering-elements-from-k-lists
0726-number-of-atoms
0948-sort-an-array
1256-rank-transform-of-an-array
1333-sort-the-jumbled-numbers
1556-make-two-arrays-equal-by-reversing-subarrays
1615-range-sum-of-sorted-subarray-sums
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1741-sort-array-by-increasing-frequency
2179-most-beautiful-item-for-each-query
2488-divide-intervals-into-minimum-number-of-groups
2502-sort-the-people
2581-divide-players-into-teams-of-equal-skill
2586-longest-square-streak-in-an-array
2695-find-score-of-an-array-after-marking-all-elements
2846-robot-collisions
3276-minimum-number-of-pushes-to-type-word-ii
3291-find-if-array-can-be-sorted

Depth-First Search

0145-binary-tree-postorder-traversal
0404-sum-of-left-leaves
0514-freedom-trail
0543-diameter-of-binary-tree
0776-n-ary-tree-postorder-traversal
0999-regions-cut-by-slashes
1207-delete-nodes-and-return-forest
1350-remove-sub-folders-from-the-filesystem
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1653-number-of-good-leaf-nodes-pairs
1691-minimum-number-of-days-to-disconnect-island
2121-find-if-path-exists-in-graph
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2545-height-of-binary-tree-after-subtree-removal-queries
2677-cousins-in-binary-tree-ii

Breadth-First Search

0279-perfect-squares
0404-sum-of-left-leaves
0514-freedom-trail
0999-regions-cut-by-slashes
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1691-minimum-number-of-days-to-disconnect-island
2121-find-if-path-exists-in-graph
2171-second-minimum-time-to-reach-destination
2545-height-of-binary-tree-after-subtree-removal-queries
2677-cousins-in-binary-tree-ii

Graph

1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1701-remove-max-number-of-edges-to-keep-graph-fully-traversable
2121-find-if-path-exists-in-graph
2171-second-minimum-time-to-reach-destination
2472-build-a-matrix-with-conditions
3235-minimum-cost-to-convert-string-i

Topological Sort

1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
2472-build-a-matrix-with-conditions

Union Find

0999-regions-cut-by-slashes
1701-remove-max-number-of-edges-to-keep-graph-fully-traversable
2121-find-if-path-exists-in-graph

String

0008-string-to-integer-atoi
0020-valid-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0049-group-anagrams
0058-length-of-last-word
0067-add-binary
0076-minimum-window-substring
0214-shortest-palindrome
0242-valid-anagram
0273-integer-to-english-words
0387-first-unique-character-in-a-string
0402-remove-k-digits
0451-sort-characters-by-frequency
0514-freedom-trail
0592-fraction-addition-and-subtraction
0664-strange-printer
0726-number-of-atoms
0812-rotate-string
0957-minimum-add-to-make-parentheses-valid
1197-parsing-a-boolean-expression
1298-reverse-substrings-between-each-pair-of-parentheses
1304-longest-happy-string
1350-remove-sub-folders-from-the-filesystem
1667-find-kth-bit-in-nth-binary-string
1715-split-a-string-into-the-max-number-of-unique-substrings
1720-crawler-log-folder
1756-minimum-deletions-to-make-string-balanced
1818-maximum-score-from-removing-substrings
1923-sentence-similarity-iii
2163-kth-distinct-string-in-an-array
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2292-counting-words-with-a-given-prefix
2414-move-pieces-to-obtain-a-string
2502-sort-the-people
2599-take-k-of-each-character-from-left-and-right
2727-number-of-senior-citizens
2800-minimum-string-length-after-removing-substrings
3195-separate-black-and-white-balls
3235-minimum-cost-to-convert-string-i
3276-minimum-number-of-pushes-to-type-word-ii

Stack

0020-valid-parentheses
0143-reorder-list
0145-binary-tree-postorder-traversal
0402-remove-k-digits
0726-number-of-atoms
0776-n-ary-tree-postorder-traversal
0957-minimum-add-to-make-parentheses-valid
1002-maximum-width-ramp
1197-parsing-a-boolean-expression
1298-reverse-substrings-between-each-pair-of-parentheses
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1720-crawler-log-folder
1756-minimum-deletions-to-make-string-balanced
1818-maximum-score-from-removing-substrings
2800-minimum-string-length-after-removing-substrings
2846-robot-collisions

Linked List

0021-merge-two-sorted-lists
0143-reorder-list
0432-all-oone-data-structure
2182-find-the-minimum-and-maximum-number-of-nodes-between-critical-points
2299-merge-nodes-in-between-zeros

Recursion

0021-merge-two-sorted-lists
0143-reorder-list
0273-integer-to-english-words
1197-parsing-a-boolean-expression
1667-find-kth-bit-in-nth-binary-string
1951-find-the-winner-of-the-circular-game

Hash Table

0041-first-missing-positive
0049-group-anagrams
0076-minimum-window-substring
0242-valid-anagram
0264-ugly-number-ii
0350-intersection-of-two-arrays-ii
0387-first-unique-character-in-a-string
0432-all-oone-data-structure
0451-sort-characters-by-frequency
0621-task-scheduler
0632-smallest-range-covering-elements-from-k-lists
0726-number-of-atoms
0870-magic-squares-in-grid
0999-regions-cut-by-slashes
1207-delete-nodes-and-return-forest
1256-rank-transform-of-an-array
1556-make-two-arrays-equal-by-reversing-subarrays
1620-check-if-array-pairs-are-divisible-by-k
1694-make-sum-divisible-by-p
1715-split-a-string-into-the-max-number-of-unique-substrings
1741-sort-array-by-increasing-frequency
2054-the-number-of-the-smallest-unoccupied-chair
2163-kth-distinct-string-in-an-array
2306-create-binary-tree-from-descriptions
2502-sort-the-people
2581-divide-players-into-teams-of-equal-skill
2586-longest-square-streak-in-an-array
2599-take-k-of-each-character-from-left-and-right
2677-cousins-in-binary-tree-ii
2695-find-score-of-an-array-after-marking-all-elements
3276-minimum-number-of-pushes-to-type-word-ii

Binary Search

0350-intersection-of-two-arrays-ii
1615-range-sum-of-sorted-subarray-sums
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1766-minimum-number-of-removals-to-make-mountain-array
2179-most-beautiful-item-for-each-query
2586-longest-square-streak-in-an-array

Sliding Window

0076-minimum-window-substring
0632-smallest-range-covering-elements-from-k-lists
2255-minimum-swaps-to-group-all-1s-together-ii
2599-take-k-of-each-character-from-left-and-right
3380-shortest-subarray-with-or-at-least-k-ii
3522-find-the-power-of-k-size-subarrays-i

Queue

0387-first-unique-character-in-a-string
0954-maximum-sum-circular-subarray
1951-find-the-winner-of-the-circular-game

Counting

0387-first-unique-character-in-a-string
0451-sort-characters-by-frequency
0621-task-scheduler
1620-check-if-array-pairs-are-divisible-by-k
2163-kth-distinct-string-in-an-array
3276-minimum-number-of-pushes-to-type-word-ii

Greedy

0402-remove-k-digits
0452-minimum-number-of-arrows-to-burst-balloons
0621-task-scheduler
0624-maximum-distance-in-arrays
0632-smallest-range-covering-elements-from-k-lists
0670-maximum-swap
0957-minimum-add-to-make-parentheses-valid
1304-longest-happy-string
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1711-find-valid-matrix-given-row-and-column-sums
1762-furthest-building-you-can-reach
1766-minimum-number-of-removals-to-make-mountain-array
1818-maximum-score-from-removing-substrings
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
3195-separate-black-and-white-balls
3276-minimum-number-of-pushes-to-type-word-ii

Heap (Priority Queue)

0264-ugly-number-ii
0451-sort-characters-by-frequency
0621-task-scheduler
0632-smallest-range-covering-elements-from-k-lists
0789-kth-largest-element-in-a-stream
0948-sort-an-array
1304-longest-happy-string
1762-furthest-building-you-can-reach
2054-the-number-of-the-smallest-unoccupied-chair
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
2695-find-score-of-an-array-after-marking-all-elements

Bucket Sort

0451-sort-characters-by-frequency
0948-sort-an-array

Simulation

0067-add-binary
0592-fraction-addition-and-subtraction
0921-spiral-matrix-iii
1642-water-bottles
1667-find-kth-bit-in-nth-binary-string
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2299-merge-nodes-in-between-zeros
2645-pass-the-pillow
2695-find-score-of-an-array-after-marking-all-elements
2800-minimum-string-length-after-removing-substrings
2846-robot-collisions

Math

0067-add-binary
0189-rotate-array
0264-ugly-number-ii
0273-integer-to-english-words
0279-perfect-squares
0368-largest-divisible-subset
0592-fraction-addition-and-subtraction
0650-2-keys-keyboard
0670-maximum-swap
0870-magic-squares-in-grid
1240-stone-game-ii
1642-water-bottles
1951-find-the-winner-of-the-circular-game
2645-pass-the-pillow

Dynamic Programming

0264-ugly-number-ii
0279-perfect-squares
0368-largest-divisible-subset
0514-freedom-trail
0650-2-keys-keyboard
0664-strange-printer
0954-maximum-sum-circular-subarray
1196-filling-bookcase-shelves
1240-stone-game-ii
1376-selling-pieces-of-wood
1402-count-square-submatrices-with-all-ones
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1511-count-number-of-teams
1756-minimum-deletions-to-make-string-balanced
1766-minimum-number-of-removals-to-make-mountain-array
2067-maximum-number-of-points-with-cost
2586-longest-square-streak-in-an-array
2794-maximum-number-of-moves-in-a-grid

Prefix Sum

0238-product-of-array-except-self
1240-stone-game-ii
1694-make-sum-divisible-by-p
2358-number-of-ways-to-split-array
2488-divide-intervals-into-minimum-number-of-groups

Tree

0145-binary-tree-postorder-traversal
0404-sum-of-left-leaves
0543-diameter-of-binary-tree
0776-n-ary-tree-postorder-traversal
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
1653-number-of-good-leaf-nodes-pairs
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2306-create-binary-tree-from-descriptions
2545-height-of-binary-tree-after-subtree-removal-queries
2677-cousins-in-binary-tree-ii

Binary Tree

0145-binary-tree-postorder-traversal
0404-sum-of-left-leaves
0543-diameter-of-binary-tree
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
1653-number-of-good-leaf-nodes-pairs
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2306-create-binary-tree-from-descriptions
2545-height-of-binary-tree-after-subtree-removal-queries
2677-cousins-in-binary-tree-ii

Bit Manipulation

0067-add-binary
0201-bitwise-and-of-numbers-range
2170-count-number-of-maximum-bitwise-or-subsets
3291-find-if-array-can-be-sorted
3380-shortest-subarray-with-or-at-least-k-ii

Memoization

1376-selling-pieces-of-wood

Monotonic Stack

0402-remove-k-digits
1002-maximum-width-ramp
1679-shortest-subarray-to-be-removed-to-make-array-sorted

Matrix

0870-magic-squares-in-grid
0921-spiral-matrix-iii
0999-regions-cut-by-slashes
1402-count-square-submatrices-with-all-ones
1691-minimum-number-of-days-to-disconnect-island
1711-find-valid-matrix-given-row-and-column-sums
2472-build-a-matrix-with-conditions
2794-maximum-number-of-moves-in-a-grid

Divide and Conquer

0948-sort-an-array
0954-maximum-sum-circular-subarray

Merge Sort

0948-sort-an-array

Radix Sort

0948-sort-an-array

Counting Sort

0274-h-index
0948-sort-an-array

Shortest Path

1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
2171-second-minimum-time-to-reach-destination
3235-minimum-cost-to-convert-string-i

Binary Indexed Tree

1511-count-number-of-teams

Strongly Connected Component

1691-minimum-number-of-days-to-disconnect-island

Design

0432-all-oone-data-structure
0789-kth-largest-element-in-a-stream

Binary Search Tree

0789-kth-largest-element-in-a-stream

Data Stream

0789-kth-largest-element-in-a-stream

Game Theory

1240-stone-game-ii

Doubly-Linked List

0432-all-oone-data-structure

Backtracking

1715-split-a-string-into-the-max-number-of-unique-substrings
2170-count-number-of-maximum-bitwise-or-subsets

Enumeration

2170-count-number-of-maximum-bitwise-or-subsets

Trie

0440-k-th-smallest-in-lexicographical-order
1350-remove-sub-folders-from-the-filesystem

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
0214-shortest-palindrome
0812-rotate-string
2292-counting-words-with-a-given-prefix

Monotonic Queue

0954-maximum-sum-circular-subarray

Rolling Hash

0214-shortest-palindrome

Hash Function

0214-shortest-palindrome

About

My Daily Leet Code questions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages