Skip to content

ADITYAGABA1322/Daily-LeetCode-Challenge-Solution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Daily-LeetCode-Challenge-Solution πŸ‘€

MasterHead

Hi Everyone. It's me Aditya and Here I'm providing you Daily LeetCode Challenge Solution with a full Explanation(Line to Line)

In Nine Languages:

C++🫢 && JAVA && Python && Python3 && C && C# && JavaScript && Swift && Dart πŸ”₯

LeetCode Topics

Greedy

0045-jump-game-ii
0055-jump-game
0624-maximum-distance-in-arrays
0890-lemonade-change
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1711-find-valid-matrix-given-row-and-column-sums
1818-maximum-score-from-removing-substrings
2379-maximum-total-importance-of-roads
2538-minimum-cost-to-make-array-equal
3229-minimum-cost-to-make-array-equalindromic
3276-minimum-number-of-pushes-to-type-word-ii

Graph

0133-clone-graph
0984-most-stones-removed-with-same-row-or-column
1325-path-with-maximum-probability
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
2171-second-minimum-time-to-reach-destination
2379-maximum-total-importance-of-roads
2472-build-a-matrix-with-conditions
2803-modify-graph-edge-weights
3235-minimum-cost-to-convert-string-i
3271-count-the-number-of-houses-at-a-certain-distance-i

Sorting

0049-group-anagrams
0217-contains-duplicate
0350-intersection-of-two-arrays-ii
0462-minimum-moves-to-equal-array-elements-ii
0719-find-k-th-smallest-pair-distance
0726-number-of-atoms
0948-sort-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
2379-maximum-total-importance-of-roads
2502-sort-the-people
2538-minimum-cost-to-make-array-equal
2718-minimum-operations-to-make-all-array-elements-equal
2846-robot-collisions
3229-minimum-cost-to-make-array-equalindromic
3276-minimum-number-of-pushes-to-type-word-ii

Heap (Priority Queue)

0264-ugly-number-ii
0789-kth-largest-element-in-a-stream
0948-sort-an-array
1325-path-with-maximum-probability
2379-maximum-total-importance-of-roads
2803-modify-graph-edge-weights

Breadth-First Search

0133-clone-graph
0322-coin-change
0999-regions-cut-by-slashes
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1691-minimum-number-of-days-to-disconnect-island
2035-count-sub-islands
2171-second-minimum-time-to-reach-destination
3271-count-the-number-of-houses-at-a-certain-distance-i

Prefix Sum

0238-product-of-array-except-self
1240-stone-game-ii
2006-find-the-student-that-will-replace-the-chalk
2538-minimum-cost-to-make-array-equal
2718-minimum-operations-to-make-all-array-elements-equal
3271-count-the-number-of-houses-at-a-certain-distance-i

Depth-First Search

0133-clone-graph
0145-binary-tree-postorder-traversal
0236-lowest-common-ancestor-of-a-binary-tree
0776-n-ary-tree-postorder-traversal
0984-most-stones-removed-with-same-row-or-column
0999-regions-cut-by-slashes
1207-delete-nodes-and-return-forest
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1691-minimum-number-of-days-to-disconnect-island
2035-count-sub-islands
2217-step-by-step-directions-from-a-binary-tree-node-to-another

Topological Sort

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

Two Pointers

0005-longest-palindromic-substring
0042-trapping-rain-water
0350-intersection-of-two-arrays-ii
0647-palindromic-substrings
0719-find-k-th-smallest-pair-distance
1615-range-sum-of-sorted-subarray-sums

String

0005-longest-palindromic-substring
0010-regular-expression-matching
0049-group-anagrams
0091-decode-ways
0139-word-break
0214-shortest-palindrome
0273-integer-to-english-words
0516-longest-palindromic-subsequence
0564-find-the-closest-palindrome
0592-fraction-addition-and-subtraction
0647-palindromic-substrings
0664-strange-printer
0726-number-of-atoms
1250-longest-common-subsequence
1298-reverse-substrings-between-each-pair-of-parentheses
1720-crawler-log-folder
1818-maximum-score-from-removing-substrings
2076-sum-of-digits-of-string-after-convert
2163-kth-distinct-string-in-an-array
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2502-sort-the-people
2727-number-of-senior-citizens
3235-minimum-cost-to-convert-string-i
3276-minimum-number-of-pushes-to-type-word-ii

Dynamic Programming

0005-longest-palindromic-substring
0010-regular-expression-matching
0042-trapping-rain-water
0045-jump-game-ii
0053-maximum-subarray
0055-jump-game
0062-unique-paths
0063-unique-paths-ii
0091-decode-ways
0139-word-break
0152-maximum-product-subarray
0198-house-robber
0213-house-robber-ii
0264-ugly-number-ii
0300-longest-increasing-subsequence
0322-coin-change
0377-combination-sum-iv
0516-longest-palindromic-subsequence
0647-palindromic-substrings
0650-2-keys-keyboard
0664-strange-printer
1240-stone-game-ii
1250-longest-common-subsequence
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1511-count-number-of-teams
2067-maximum-number-of-points-with-cost

Rolling Hash

0214-shortest-palindrome

String Matching

0214-shortest-palindrome

Hash Function

0214-shortest-palindrome

Union Find

0128-longest-consecutive-sequence
0984-most-stones-removed-with-same-row-or-column
0999-regions-cut-by-slashes
1701-remove-max-number-of-edges-to-keep-graph-fully-traversable
2035-count-sub-islands

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0033-search-in-rotated-sorted-array
0040-combination-sum-ii
0042-trapping-rain-water
0045-jump-game-ii
0049-group-anagrams
0053-maximum-subarray
0055-jump-game
0063-unique-paths-ii
0128-longest-consecutive-sequence
0139-word-break
0152-maximum-product-subarray
0198-house-robber
0213-house-robber-ii
0217-contains-duplicate
0238-product-of-array-except-self
0300-longest-increasing-subsequence
0307-range-sum-query-mutable
0322-coin-change
0350-intersection-of-two-arrays-ii
0377-combination-sum-iv
0453-minimum-moves-to-equal-array-elements
0462-minimum-moves-to-equal-array-elements-ii
0624-maximum-distance-in-arrays
0719-find-k-th-smallest-pair-distance
0870-magic-squares-in-grid
0890-lemonade-change
0921-spiral-matrix-iii
0948-sort-an-array
0999-regions-cut-by-slashes
1207-delete-nodes-and-return-forest
1240-stone-game-ii
1293-three-consecutive-odds
1325-path-with-maximum-probability
1333-sort-the-jumbled-numbers
1496-lucky-numbers-in-a-matrix
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
1691-minimum-number-of-days-to-disconnect-island
1711-find-valid-matrix-given-row-and-column-sums
1720-crawler-log-folder
1741-sort-array-by-increasing-frequency
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2006-find-the-student-that-will-replace-the-chalk
2035-count-sub-islands
2067-maximum-number-of-points-with-cost
2132-convert-1d-array-into-2d-array
2163-kth-distinct-string-in-an-array
2255-minimum-swaps-to-group-all-1s-together-ii
2306-create-binary-tree-from-descriptions
2472-build-a-matrix-with-conditions
2502-sort-the-people
2538-minimum-cost-to-make-array-equal
2718-minimum-operations-to-make-all-array-elements-equal
2727-number-of-senior-citizens
2846-robot-collisions
3229-minimum-cost-to-make-array-equalindromic
3235-minimum-cost-to-convert-string-i

Design

0307-range-sum-query-mutable
0789-kth-largest-element-in-a-stream

Binary Indexed Tree

0307-range-sum-query-mutable
1511-count-number-of-teams

Segment Tree

0307-range-sum-query-mutable

Stack

0042-trapping-rain-water
0145-binary-tree-postorder-traversal
0726-number-of-atoms
0776-n-ary-tree-postorder-traversal
1298-reverse-substrings-between-each-pair-of-parentheses
1720-crawler-log-folder
1818-maximum-score-from-removing-substrings
2846-robot-collisions

Monotonic Stack

0042-trapping-rain-water

Hash Table

0001-two-sum
0049-group-anagrams
0128-longest-consecutive-sequence
0133-clone-graph
0139-word-break
0217-contains-duplicate
0264-ugly-number-ii
0350-intersection-of-two-arrays-ii
0726-number-of-atoms
0870-magic-squares-in-grid
0984-most-stones-removed-with-same-row-or-column
0999-regions-cut-by-slashes
1207-delete-nodes-and-return-forest
1556-make-two-arrays-equal-by-reversing-subarrays
1741-sort-array-by-increasing-frequency
2163-kth-distinct-string-in-an-array
2306-create-binary-tree-from-descriptions
2502-sort-the-people
3276-minimum-number-of-pushes-to-type-word-ii

Binary Search

0004-median-of-two-sorted-arrays
0033-search-in-rotated-sorted-array
0300-longest-increasing-subsequence
0350-intersection-of-two-arrays-ii
0719-find-k-th-smallest-pair-distance
1615-range-sum-of-sorted-subarray-sums
2006-find-the-student-that-will-replace-the-chalk
2538-minimum-cost-to-make-array-equal
2718-minimum-operations-to-make-all-array-elements-equal

Linked List

2182-find-the-minimum-and-maximum-number-of-nodes-between-critical-points
2299-merge-nodes-in-between-zeros

Simulation

0592-fraction-addition-and-subtraction
0921-spiral-matrix-iii
1642-water-bottles
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2006-find-the-student-that-will-replace-the-chalk
2076-sum-of-digits-of-string-after-convert
2132-convert-1d-array-into-2d-array
2299-merge-nodes-in-between-zeros
2645-pass-the-pillow
2846-robot-collisions

Recursion

0010-regular-expression-matching
0273-integer-to-english-words
1951-find-the-winner-of-the-circular-game

Divide and Conquer

0004-median-of-two-sorted-arrays
0053-maximum-subarray
0948-sort-an-array

Math

0062-unique-paths
0264-ugly-number-ii
0273-integer-to-english-words
0371-sum-of-two-integers
0453-minimum-moves-to-equal-array-elements
0462-minimum-moves-to-equal-array-elements-ii
0564-find-the-closest-palindrome
0592-fraction-addition-and-subtraction
0650-2-keys-keyboard
0870-magic-squares-in-grid
1240-stone-game-ii
1642-water-bottles
1951-find-the-winner-of-the-circular-game
2645-pass-the-pillow
3229-minimum-cost-to-make-array-equalindromic

Combinatorics

0062-unique-paths

Matrix

0063-unique-paths-ii
0870-magic-squares-in-grid
0921-spiral-matrix-iii
0999-regions-cut-by-slashes
1496-lucky-numbers-in-a-matrix
1691-minimum-number-of-days-to-disconnect-island
1711-find-valid-matrix-given-row-and-column-sums
2035-count-sub-islands
2132-convert-1d-array-into-2d-array
2472-build-a-matrix-with-conditions

Queue

1951-find-the-winner-of-the-circular-game

Tree

0145-binary-tree-postorder-traversal
0236-lowest-common-ancestor-of-a-binary-tree
0776-n-ary-tree-postorder-traversal
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2306-create-binary-tree-from-descriptions

Binary Tree

0145-binary-tree-postorder-traversal
0236-lowest-common-ancestor-of-a-binary-tree
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2306-create-binary-tree-from-descriptions

Merge Sort

0948-sort-an-array

Bucket Sort

0948-sort-an-array

Radix Sort

0948-sort-an-array

Counting Sort

0948-sort-an-array
2163-kth-distinct-string-in-an-array
3276-minimum-number-of-pushes-to-type-word-ii

Shortest Path

1325-path-with-maximum-probability
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
2171-second-minimum-time-to-reach-destination
2803-modify-graph-edge-weights
3235-minimum-cost-to-convert-string-i

Bit Manipulation

0371-sum-of-two-integers
0476-number-complement

Trie

0139-word-break

Memoization

0139-word-break

Sliding Window

2255-minimum-swaps-to-group-all-1s-together-ii

Strongly Connected Component

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

Binary Search Tree

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

Data Stream

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

Backtracking

0040-combination-sum-ii

Game Theory

1240-stone-game-ii