Skip to content

kalkikumar57/Leetcode_solution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,329 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode_solution

Collection of LeetCode questions to ace the coding interview! - Created using LeetHub

LeetCode Topics

Array

0042-trapping-rain-water
0073-set-matrix-zeroes
0075-sort-colors
0407-trapping-rain-water-ii
0594-longest-harmonious-subsequence
0854-making-a-large-island
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
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
1631-number-of-sub-arrays-with-odd-sum
1819-construct-the-lexicographically-largest-valid-sequence
1849-maximum-absolute-sum-of-any-subarray
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
2107-find-unique-binary-string
2145-grid-game
2220-find-all-possible-recipes-from-given-supplies
2262-solving-questions-with-brainpower
2265-partition-array-according-to-given-pivot
2292-counting-words-with-a-given-prefix
2308-divide-array-into-equal-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2478-longest-nice-subarray
2533-bitwise-xor-of-all-pairings
2564-most-profitable-path-in-a-tree
2588-maximum-number-of-points-from-grid-queries
2614-maximum-count-of-positive-integer-and-negative-integer
2665-minimum-time-to-repair-cars
2685-first-completely-painted-row-or-column
2690-house-robber-iv
2707-merge-two-2d-arrays-by-summing-values
2764-maximum-number-of-fish-in-a-grid
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
2888-minimum-index-of-a-valid-split
3143-longest-unequal-adjacent-groups-subsequence-i
3194-find-words-containing-character
3219-make-lexicographically-smallest-array-by-swapping-elements
3227-find-missing-and-repeated-values
3321-type-of-triangle
3348-minimum-cost-walk-in-weighted-graph
3372-longest-strictly-increasing-or-strictly-decreasing-subarray
3434-find-the-number-of-distinct-colors-among-the-balls
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii
3657-check-if-grid-can-be-cut-into-sections

String

0768-partition-labels
0952-word-subsets
1093-recover-a-tree-from-preorder-traversal
1160-letter-tile-possibilities
1170-shortest-common-supersequence
1460-number-of-substrings-containing-all-three-characters
1502-construct-k-palindrome-strings
1524-string-matching-in-an-array
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1915-check-if-one-string-swap-can-make-strings-equal
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
3143-longest-unequal-adjacent-groups-subsequence-i
3194-find-words-containing-character
3455-minimum-length-of-string-after-operations
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
3617-find-the-original-typed-string-i
3629-total-characters-in-string-after-transformations-i
3753-maximum-difference-between-even-and-odd-frequency-i

Prefix Sum

1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2145-grid-game
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

String Matching

1524-string-matching-in-an-array
2292-counting-words-with-a-given-prefix

Hash Table

0073-set-matrix-zeroes
0594-longest-harmonious-subsequence
0768-partition-labels
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0952-word-subsets
1160-letter-tile-possibilities
1364-tuple-with-same-product
1387-find-elements-in-a-contaminated-binary-tree
1460-number-of-substrings-containing-all-three-characters
1502-construct-k-palindrome-strings
1915-check-if-one-string-swap-can-make-strings-equal
2107-find-unique-binary-string
2220-find-all-possible-recipes-from-given-supplies
2308-divide-array-into-equal-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2685-first-completely-painted-row-or-column
2707-merge-two-2d-arrays-by-summing-values
2766-find-the-prefix-common-array-of-two-arrays
2888-minimum-index-of-a-valid-split
3227-find-missing-and-repeated-values
3434-find-the-number-of-distinct-colors-among-the-balls
3455-minimum-length-of-string-after-operations
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii
3629-total-characters-in-string-after-transformations-i
3753-maximum-difference-between-even-and-odd-frequency-i

Greedy

0768-partition-labels
1502-construct-k-palindrome-strings
2221-check-if-a-parentheses-string-can-be-valid
2509-minimize-xor
2704-maximum-difference-by-remapping-a-digit
3143-longest-unequal-adjacent-groups-subsequence-i

Counting

0594-longest-harmonious-subsequence
1160-letter-tile-possibilities
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
2308-divide-array-into-equal-pairs
2614-maximum-count-of-positive-integer-and-negative-integer
3455-minimum-length-of-string-after-operations
3629-total-characters-in-string-after-transformations-i
3753-maximum-difference-between-even-and-odd-frequency-i

Stack

0042-trapping-rain-water
2221-check-if-a-parentheses-string-can-be-valid

Bit Manipulation

2308-divide-array-into-equal-pairs
2478-longest-nice-subarray
2509-minimize-xor
2533-bitwise-xor-of-all-pairings
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
3348-minimum-cost-walk-in-weighted-graph
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

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
1387-find-elements-in-a-contaminated-binary-tree
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
2564-most-profitable-path-in-a-tree
2583-divide-nodes-into-the-maximum-number-of-groups
2588-maximum-number-of-points-from-grid-queries
2764-maximum-number-of-fish-in-a-grid
2793-count-the-number-of-complete-components

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
2564-most-profitable-path-in-a-tree
2583-divide-nodes-into-the-maximum-number-of-groups
2793-count-the-number-of-complete-components
3348-minimum-cost-walk-in-weighted-graph

Heap (Priority Queue)

0407-trapping-rain-water-ii
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2588-maximum-number-of-points-from-grid-queries

Matrix

0073-set-matrix-zeroes
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
2588-maximum-number-of-points-from-grid-queries
2685-first-completely-painted-row-or-column
2764-maximum-number-of-fish-in-a-grid
3227-find-missing-and-repeated-values

Shortest Path

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

Two Pointers

0042-trapping-rain-water
0061-rotate-list
0075-sort-colors
0768-partition-labels
2265-partition-array-according-to-given-pivot
2588-maximum-number-of-points-from-grid-queries
2707-merge-two-2d-arrays-by-summing-values

Dynamic Programming

0042-trapping-rain-water
0905-length-of-longest-fibonacci-subsequence
1170-shortest-common-supersequence
1631-number-of-sub-arrays-with-odd-sum
1849-maximum-absolute-sum-of-any-subarray
2090-number-of-ways-to-arrive-at-destination
2262-solving-questions-with-brainpower
3143-longest-unequal-adjacent-groups-subsequence-i
3629-total-characters-in-string-after-transformations-i

Monotonic Stack

0042-trapping-rain-water

Depth-First Search

0684-redundant-connection
0820-find-eventual-safe-states
0854-making-a-large-island
1093-recover-a-tree-from-preorder-traversal
1387-find-elements-in-a-contaminated-binary-tree
1396-count-servers-that-communicate
1558-course-schedule-iv
2246-maximum-employees-to-be-invited-to-a-meeting
2564-most-profitable-path-in-a-tree
2764-maximum-number-of-fish-in-a-grid
2793-count-the-number-of-complete-components

Union Find

0684-redundant-connection
0854-making-a-large-island
1396-count-servers-that-communicate
2583-divide-nodes-into-the-maximum-number-of-groups
2588-maximum-number-of-points-from-grid-queries
2764-maximum-number-of-fish-in-a-grid
2793-count-the-number-of-complete-components
3219-make-lexicographically-smallest-array-by-swapping-elements
3348-minimum-cost-walk-in-weighted-graph

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

0075-sort-colors
0594-longest-harmonious-subsequence
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2588-maximum-number-of-points-from-grid-queries
2888-minimum-index-of-a-valid-split
3219-make-lexicographically-smallest-array-by-swapping-elements
3321-type-of-triangle
3657-check-if-grid-can-be-cut-into-sections

Simulation

2265-partition-array-according-to-given-pivot
3434-find-the-number-of-distinct-colors-among-the-balls

Math

1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
1889-check-if-number-is-a-sum-of-powers-of-three
2649-count-total-number-of-colored-cells
2704-maximum-difference-by-remapping-a-digit
2802-find-the-punishment-number-of-an-integer
3227-find-missing-and-repeated-values
3321-type-of-triangle
3629-total-characters-in-string-after-transformations-i

Design

1387-find-elements-in-a-contaminated-binary-tree
1477-product-of-the-last-k-numbers

Data Stream

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

Backtracking

1160-letter-tile-possibilities
1819-construct-the-lexicographically-largest-valid-sequence
2107-find-unique-binary-string
2802-find-the-punishment-number-of-an-integer

Tree

0925-construct-binary-tree-from-preorder-and-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
1387-find-elements-in-a-contaminated-binary-tree
2564-most-profitable-path-in-a-tree

Binary Tree

0925-construct-binary-tree-from-preorder-and-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
1387-find-elements-in-a-contaminated-binary-tree

Linked List

0061-rotate-list

Divide and Conquer

0925-construct-binary-tree-from-preorder-and-postorder-traversal

Sliding Window

0594-longest-harmonious-subsequence
1460-number-of-substrings-containing-all-three-characters
2478-longest-nice-subarray
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii
3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii

Binary Search

1335-maximum-candies-allocated-to-k-children
2614-maximum-count-of-positive-integer-and-negative-integer
2665-minimum-time-to-repair-cars
2690-house-robber-iv

Queue

3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

About

Collection of LeetCode questions to ace the coding interview! - Created using [LeetHub](https://github.com/QasimWani/LeetHub)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages