Skip to content

Latest commit

 

History

277 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSA

Leetcode solution

LeetCode Topics

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0011-container-with-most-water
0015-3sum
0033-search-in-rotated-sorted-array
0036-valid-sudoku
0042-trapping-rain-water
0049-group-anagrams
0074-search-a-2d-matrix
0084-largest-rectangle-in-histogram
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0121-best-time-to-buy-and-sell-stock
0128-longest-consecutive-sequence
0150-evaluate-reverse-polish-notation
0153-find-minimum-in-rotated-sorted-array
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0217-contains-duplicate
0238-product-of-array-except-self
0239-sliding-window-maximum
0287-find-the-duplicate-number
0347-top-k-frequent-elements
0485-max-consecutive-ones
0643-maximum-average-subarray-i
0704-binary-search
0739-daily-temperatures
0853-car-fleet
0875-koko-eating-bananas
1470-shuffle-the-array
1929-concatenation-of-array
3969-valid-subarrays-with-matching-sum-digits-i

Two Pointers

0011-container-with-most-water
0015-3sum
0019-remove-nth-node-from-end-of-list
0042-trapping-rain-water
0125-valid-palindrome
0141-linked-list-cycle
0143-reorder-list
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0287-find-the-duplicate-number
0567-permutation-in-string

Binary Search

0004-median-of-two-sorted-arrays
0033-search-in-rotated-sorted-array
0074-search-a-2d-matrix
0153-find-minimum-in-rotated-sorted-array
0167-two-sum-ii-input-array-is-sorted
0287-find-the-duplicate-number
0704-binary-search
0875-koko-eating-bananas
0981-time-based-key-value-store

Hash Table

0001-two-sum
0036-valid-sudoku
0049-group-anagrams
0076-minimum-window-substring
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0128-longest-consecutive-sequence
0138-copy-list-with-random-pointer
0141-linked-list-cycle
0146-lru-cache
0217-contains-duplicate
0242-valid-anagram
0347-top-k-frequent-elements
0424-longest-repeating-character-replacement
0567-permutation-in-string
0981-time-based-key-value-store
3969-valid-subarrays-with-matching-sum-digits-i

String

0020-valid-parentheses
0022-generate-parentheses
0049-group-anagrams
0076-minimum-window-substring
0125-valid-palindrome
0242-valid-anagram
0297-serialize-and-deserialize-binary-tree
0424-longest-repeating-character-replacement
0567-permutation-in-string
0981-time-based-key-value-store
3968-maximum-manhattan-distance-after-all-moves

Sorting

0015-3sum
0049-group-anagrams
0217-contains-duplicate
0242-valid-anagram
0347-top-k-frequent-elements
0853-car-fleet

Divide and Conquer

0004-median-of-two-sorted-arrays
0023-merge-k-sorted-lists
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0347-top-k-frequent-elements

Heap (Priority Queue)

0023-merge-k-sorted-lists
0239-sliding-window-maximum
0347-top-k-frequent-elements

Bucket Sort

0347-top-k-frequent-elements

Counting

0347-top-k-frequent-elements
3968-maximum-manhattan-distance-after-all-moves

Quickselect

0347-top-k-frequent-elements

Prefix Sum

0238-product-of-array-except-self
3969-valid-subarrays-with-matching-sum-digits-i

Matrix

0036-valid-sudoku
0074-search-a-2d-matrix

Sliding Window

0076-minimum-window-substring
0239-sliding-window-maximum
0424-longest-repeating-character-replacement
0567-permutation-in-string
0643-maximum-average-subarray-i
3969-valid-subarrays-with-matching-sum-digits-i

Union-Find

0128-longest-consecutive-sequence

Dynamic Programming

0022-generate-parentheses
0042-trapping-rain-water
0121-best-time-to-buy-and-sell-stock
0124-binary-tree-maximum-path-sum

Stack

0020-valid-parentheses
0042-trapping-rain-water
0084-largest-rectangle-in-histogram
0143-reorder-list
0150-evaluate-reverse-polish-notation
0155-min-stack
0739-daily-temperatures
0853-car-fleet

Monotonic Stack

0042-trapping-rain-water
0084-largest-rectangle-in-histogram
0739-daily-temperatures
0853-car-fleet

Queue

0239-sliding-window-maximum

Monotonic Queue

0239-sliding-window-maximum

Design

0146-lru-cache
0155-min-stack
0297-serialize-and-deserialize-binary-tree
0981-time-based-key-value-store

Math

0002-add-two-numbers
0150-evaluate-reverse-polish-notation
0189-rotate-array
3968-maximum-manhattan-distance-after-all-moves

Simulation

1929-concatenation-of-array

Enumeration

3969-valid-subarrays-with-matching-sum-digits-i

Greedy

0011-container-with-most-water

Backtracking

0022-generate-parentheses

Linked List

0002-add-two-numbers
0019-remove-nth-node-from-end-of-list
0021-merge-two-sorted-lists
0023-merge-k-sorted-lists
0025-reverse-nodes-in-k-group
0138-copy-list-with-random-pointer
0141-linked-list-cycle
0143-reorder-list
0146-lru-cache
0206-reverse-linked-list

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists
0025-reverse-nodes-in-k-group
0143-reorder-list
0206-reverse-linked-list

Floyd's Cycle Finding Algorithm

0141-linked-list-cycle
0287-find-the-duplicate-number

Bit Manipulation

0287-find-the-duplicate-number

Pigeonhole Principle

0287-find-the-duplicate-number

Doubly-Linked List

0146-lru-cache

Merge Sort

0023-merge-k-sorted-lists

Tournament Sort

0023-merge-k-sorted-lists

Tree

0098-validate-binary-search-tree
0100-same-tree
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0110-balanced-binary-tree
0124-binary-tree-maximum-path-sum
0199-binary-tree-right-side-view
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0297-serialize-and-deserialize-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
1448-count-good-nodes-in-binary-tree

Depth-First Search

0098-validate-binary-search-tree
0100-same-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0124-binary-tree-maximum-path-sum
0199-binary-tree-right-side-view
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0297-serialize-and-deserialize-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
1448-count-good-nodes-in-binary-tree

Breadth-First Search

0100-same-tree
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0199-binary-tree-right-side-view
0226-invert-binary-tree
0297-serialize-and-deserialize-binary-tree
1448-count-good-nodes-in-binary-tree

Binary Tree

0098-validate-binary-search-tree
0100-same-tree
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0110-balanced-binary-tree
0124-binary-tree-maximum-path-sum
0199-binary-tree-right-side-view
0226-invert-binary-tree
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree
0297-serialize-and-deserialize-binary-tree
0543-diameter-of-binary-tree
0572-subtree-of-another-tree
1448-count-good-nodes-in-binary-tree

DP on Trees

0124-binary-tree-maximum-path-sum
0543-diameter-of-binary-tree

String Matching

0572-subtree-of-another-tree

Hash Function

0572-subtree-of-another-tree

Binary Search Tree

0098-validate-binary-search-tree
0230-kth-smallest-element-in-a-bst
0235-lowest-common-ancestor-of-a-binary-search-tree

Binary Lifting

0235-lowest-common-ancestor-of-a-binary-search-tree

Lowest Common Ancestor

0235-lowest-common-ancestor-of-a-binary-search-tree

About

Data Structures & Algorithms solutions in C++ with explanations, optimized approaches, and interview preparation notes.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages