Skip to content

Aksshay88/Leetcode-Solution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode-Solution

Collection of LeetCode questions to ace the coding interview!

LeetCode Topics

Two Pointers

0086-partition-list
0941-sort-array-by-parity
1894-merge-strings-alternately
2216-delete-the-middle-node-of-a-linked-list
2236-maximum-twin-sum-of-a-linked-list
2392-successful-pairs-of-spells-and-potions

String

0097-interleaving-string
0115-distinct-subsequences
0126-word-ladder-ii
0127-word-ladder
0132-palindrome-partitioning-ii
0212-word-search-ii
0224-basic-calculator
0394-decode-string
0649-dota2-senate
0952-word-subsets
1146-greatest-common-divisor-of-strings
1250-longest-common-subsequence
1397-search-suggestions-system
1502-construct-k-palindrome-strings
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1567-maximum-number-of-vowels-in-a-substring-of-given-length
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
2221-check-if-a-parentheses-string-can-be-valid
2292-counting-words-with-a-given-prefix
2300-construct-string-with-repeat-limit
2465-shifting-letters-ii
2470-removing-stars-from-a-string
2691-count-vowel-strings-in-ranges
3309-count-prefix-and-suffix-pairs-i
3455-minimum-length-of-string-after-operations

Math

0149-max-points-on-a-line
0150-evaluate-reverse-polish-notation
0224-basic-calculator
0830-largest-triangle-area
0912-random-pick-with-weight
1146-greatest-common-divisor-of-strings
3555-final-array-state-after-k-multiplication-operations-i

Array

0106-construct-binary-tree-from-inorder-and-postorder-traversal
0149-max-points-on-a-line
0150-evaluate-reverse-polish-notation
0188-best-time-to-buy-and-sell-stock-iv
0209-minimum-size-subarray-sum
0212-word-search-ii
0221-maximal-square
0275-h-index-ii
0289-game-of-life
0300-longest-increasing-subsequence
0354-russian-doll-envelopes
0373-find-k-pairs-with-smallest-sums
0407-trapping-rain-water-ii
0494-target-sum
0689-maximum-sum-of-3-non-overlapping-subarrays
0748-largest-number-at-least-twice-of-others
0777-toeplitz-matrix
0780-max-chunks-to-make-sorted
0817-design-hashmap
0830-largest-triangle-area
0854-making-a-large-island
0898-transpose-matrix
0907-koko-eating-bananas
0912-random-pick-with-weight
0941-sort-array-by-parity
0952-word-subsets
0954-maximum-sum-circular-subarray
1025-minimum-cost-for-tickets
1063-best-sightseeing-pair
1249-snapshot-array
1319-unique-number-of-occurrences
1396-count-servers-that-communicate
1397-search-suggestions-system
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1524-string-matching-in-an-array
1528-kids-with-the-greatest-number-of-candies
1570-final-prices-with-a-special-discount-in-a-shop
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1917-maximum-average-pass-ratio
2145-grid-game
2292-counting-words-with-a-given-prefix
2358-number-of-ways-to-split-array
2392-successful-pairs-of-spells-and-potions
2428-equal-row-and-column-pairs
2465-shifting-letters-ii
2533-bitwise-xor-of-all-pairings
2685-first-completely-painted-row-or-column
2691-count-vowel-strings-in-ranges
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
2868-continuous-subarrays
2891-maximum-beauty-of-an-array-after-applying-operation
3181-find-building-where-alice-and-bob-can-meet
3219-make-lexicographically-smallest-array-by-swapping-elements
3309-count-prefix-and-suffix-pairs-i
3555-final-array-state-after-k-multiplication-operations-i

Binary Search

0209-minimum-size-subarray-sum
0275-h-index-ii
0300-longest-increasing-subsequence
0354-russian-doll-envelopes
0907-koko-eating-bananas
0912-random-pick-with-weight
1249-snapshot-array
1397-search-suggestions-system
2392-successful-pairs-of-spells-and-potions
2891-maximum-beauty-of-an-array-after-applying-operation
3181-find-building-where-alice-and-bob-can-meet

Sliding Window

0209-minimum-size-subarray-sum
1567-maximum-number-of-vowels-in-a-substring-of-given-length
2868-continuous-subarrays
2891-maximum-beauty-of-an-array-after-applying-operation

Prefix Sum

0209-minimum-size-subarray-sum
0912-random-pick-with-weight
1537-maximum-score-after-splitting-a-string
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2145-grid-game
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
2691-count-vowel-strings-in-ranges

Matrix

0212-word-search-ii
0221-maximal-square
0289-game-of-life
0407-trapping-rain-water-ii
0777-toeplitz-matrix
0854-making-a-large-island
0898-transpose-matrix
1396-count-servers-that-communicate
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
2145-grid-game
2428-equal-row-and-column-pairs
2685-first-completely-painted-row-or-column

Simulation

0289-game-of-life
0898-transpose-matrix
2428-equal-row-and-column-pairs
2470-removing-stars-from-a-string
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
3555-final-array-state-after-k-multiplication-operations-i

Stack

0114-flatten-binary-tree-to-linked-list
0150-evaluate-reverse-polish-notation
0155-min-stack
0224-basic-calculator
0394-decode-string
0780-max-chunks-to-make-sorted
0937-online-stock-span
1570-final-prices-with-a-special-discount-in-a-shop
2221-check-if-a-parentheses-string-can-be-valid
2236-maximum-twin-sum-of-a-linked-list
2470-removing-stars-from-a-string
3181-find-building-where-alice-and-bob-can-meet

Recursion

0224-basic-calculator
0394-decode-string

Linked List

0086-partition-list
0092-reverse-linked-list-ii
0114-flatten-binary-tree-to-linked-list
0817-design-hashmap
2216-delete-the-middle-node-of-a-linked-list
2236-maximum-twin-sum-of-a-linked-list

Design

0155-min-stack
0817-design-hashmap
0937-online-stock-span
1249-snapshot-array
2413-smallest-number-in-infinite-set

Hash Table

0106-construct-binary-tree-from-inorder-and-postorder-traversal
0126-word-ladder-ii
0127-word-ladder
0133-clone-graph
0149-max-points-on-a-line
0817-design-hashmap
0952-word-subsets
1249-snapshot-array
1319-unique-number-of-occurrences
1502-construct-k-palindrome-strings
2300-construct-string-with-repeat-limit
2413-smallest-number-in-infinite-set
2428-equal-row-and-column-pairs
2685-first-completely-painted-row-or-column
2695-find-score-of-an-array-after-marking-all-elements
2766-find-the-prefix-common-array-of-two-arrays
3455-minimum-length-of-string-after-operations

Divide and Conquer

0106-construct-binary-tree-from-inorder-and-postorder-traversal
0954-maximum-sum-circular-subarray

Tree

0103-binary-tree-zigzag-level-order-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0107-binary-tree-level-order-traversal-ii
0114-flatten-binary-tree-to-linked-list
0230-kth-smallest-element-in-a-bst
0515-find-largest-value-in-each-tree-row
0904-leaf-similar-trees
1474-longest-zigzag-path-in-a-binary-tree
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

Binary Tree

0103-binary-tree-zigzag-level-order-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0107-binary-tree-level-order-traversal-ii
0114-flatten-binary-tree-to-linked-list
0230-kth-smallest-element-in-a-bst
0515-find-largest-value-in-each-tree-row
0904-leaf-similar-trees
1474-longest-zigzag-path-in-a-binary-tree
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level

Dynamic Programming

0097-interleaving-string
0115-distinct-subsequences
0132-palindrome-partitioning-ii
0188-best-time-to-buy-and-sell-stock-iv
0221-maximal-square
0300-longest-increasing-subsequence
0354-russian-doll-envelopes
0494-target-sum
0689-maximum-sum-of-3-non-overlapping-subarrays
0954-maximum-sum-circular-subarray
1025-minimum-cost-for-tickets
1063-best-sightseeing-pair
1250-longest-common-subsequence
1474-longest-zigzag-path-in-a-binary-tree
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
2562-count-ways-to-build-good-strings

Geometry

0149-max-points-on-a-line
0830-largest-triangle-area

Heap (Priority Queue)

0373-find-k-pairs-with-smallest-sums
0407-trapping-rain-water-ii
1397-search-suggestions-system
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1917-maximum-average-pass-ratio
2300-construct-string-with-repeat-limit
2413-smallest-number-in-infinite-set
2692-take-gifts-from-the-richest-pile
2695-find-score-of-an-array-after-marking-all-elements
2868-continuous-subarrays
3181-find-building-where-alice-and-bob-can-meet
3555-final-array-state-after-k-multiplication-operations-i

Queue

0649-dota2-senate
0954-maximum-sum-circular-subarray
2868-continuous-subarrays

Monotonic Queue

0954-maximum-sum-circular-subarray
2868-continuous-subarrays

Backtracking

0126-word-ladder-ii
0212-word-search-ii
0494-target-sum

Trie

0212-word-search-ii
1397-search-suggestions-system
3309-count-prefix-and-suffix-pairs-i

Breadth-First Search

0103-binary-tree-zigzag-level-order-traversal
0107-binary-tree-level-order-traversal-ii
0126-word-ladder-ii
0127-word-ladder
0133-clone-graph
0210-course-schedule-ii
0407-trapping-rain-water-ii
0515-find-largest-value-in-each-tree-row
0854-making-a-large-island
0871-keys-and-rooms
1396-count-servers-that-communicate
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1558-course-schedule-iv
1576-reorder-routes-to-make-all-paths-lead-to-the-city-zero
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level
3439-find-minimum-diameter-after-merging-two-trees

Depth-First Search

0114-flatten-binary-tree-to-linked-list
0133-clone-graph
0210-course-schedule-ii
0230-kth-smallest-element-in-a-bst
0515-find-largest-value-in-each-tree-row
0854-making-a-large-island
0871-keys-and-rooms
0904-leaf-similar-trees
1396-count-servers-that-communicate
1474-longest-zigzag-path-in-a-binary-tree
1558-course-schedule-iv
1576-reorder-routes-to-make-all-paths-lead-to-the-city-zero
2493-reverse-odd-levels-of-binary-tree
3058-maximum-number-of-k-divisible-components
3439-find-minimum-diameter-after-merging-two-trees

Graph

0133-clone-graph
0210-course-schedule-ii
0871-keys-and-rooms
1485-minimum-cost-to-make-at-least-one-valid-path-in-a-grid
1558-course-schedule-iv
1576-reorder-routes-to-make-all-paths-lead-to-the-city-zero
3439-find-minimum-diameter-after-merging-two-trees

Topological Sort

0210-course-schedule-ii
1558-course-schedule-iv

Binary Search Tree

0230-kth-smallest-element-in-a-bst

Monotonic Stack

0780-max-chunks-to-make-sorted
0937-online-stock-span
1570-final-prices-with-a-special-discount-in-a-shop
3181-find-building-where-alice-and-bob-can-meet

Data Stream

0937-online-stock-span

Sorting

0354-russian-doll-envelopes
0748-largest-number-at-least-twice-of-others
0780-max-chunks-to-make-sorted
0941-sort-array-by-parity
1397-search-suggestions-system
2392-successful-pairs-of-spells-and-potions
2695-find-score-of-an-array-after-marking-all-elements
2891-maximum-beauty-of-an-array-after-applying-operation
3219-make-lexicographically-smallest-array-by-swapping-elements

Ordered Set

2413-smallest-number-in-infinite-set
2868-continuous-subarrays

Greedy

0649-dota2-senate
0780-max-chunks-to-make-sorted
1502-construct-k-palindrome-strings
1917-maximum-average-pass-ratio
2221-check-if-a-parentheses-string-can-be-valid
2300-construct-string-with-repeat-limit
2509-minimize-xor

Randomized

0912-random-pick-with-weight

Bit Manipulation

0461-hamming-distance
0693-binary-number-with-alternating-bits
2509-minimize-xor
2533-bitwise-xor-of-all-pairings
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor

Hash Function

0817-design-hashmap
3309-count-prefix-and-suffix-pairs-i

Counting

1396-count-servers-that-communicate
1502-construct-k-palindrome-strings
2300-construct-string-with-repeat-limit
3455-minimum-length-of-string-after-operations

Binary Indexed Tree

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

Segment Tree

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

String Matching

1524-string-matching-in-an-array
2292-counting-words-with-a-given-prefix
3309-count-prefix-and-suffix-pairs-i

Rolling Hash

3309-count-prefix-and-suffix-pairs-i

Brainteaser

2533-bitwise-xor-of-all-pairings

Shortest Path

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

Union Find

0854-making-a-large-island
1396-count-servers-that-communicate
3219-make-lexicographically-smallest-array-by-swapping-elements

About

Collection of LeetCode questions to ace the coding interview!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published