Skip to content

sidocoder/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

582 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

LeetCode Topics

Array

0035-search-insert-position
0064-minimum-path-sum
0074-search-a-2d-matrix
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0130-surrounded-regions
0136-single-number
0198-house-robber
0215-kth-largest-element-in-an-array
0219-contains-duplicate-ii
0268-missing-number
0275-h-index-ii
0300-longest-increasing-subsequence
0329-longest-increasing-path-in-a-matrix
0347-top-k-frequent-elements
0448-find-all-numbers-disappeared-in-an-array
0455-assign-cookies
0463-island-perimeter
0494-target-sum
0529-minesweeper
0542-01-matrix
0721-accounts-merge
0733-flood-fill
0746-min-cost-climbing-stairs
0772-construct-quad-tree
0881-loud-and-rich
0945-snakes-and-ladders
0960-minimize-malware-spread
1032-satisfiability-of-equality-equations
1036-rotting-oranges
1039-find-the-town-judge
1335-maximum-candies-allocated-to-k-children
1435-xor-queries-of-a-subarray
1507-check-if-there-is-a-valid-path-in-a-grid
1514-path-with-maximum-probability
1675-magnetic-force-between-two-balls
1706-min-cost-to-connect-all-points
1762-furthest-building-you-can-reach
1863-sum-of-all-subset-xor-totals
1876-map-of-highest-peak
1930-maximum-number-of-consecutive-values-you-can-make
1962-single-threaded-cpu
2140-solving-questions-with-brainpower
2206-detonate-the-maximum-bombs
2478-longest-nice-subarray
2527-count-subarrays-with-fixed-bounds
2533-bitwise-xor-of-all-pairings
2606-difference-between-ones-and-zeros-in-row-and-column
2621-find-xor-beauty-of-array
2976-minimum-cost-to-convert-string-i
3523-find-the-power-of-k-size-subarrays-ii
3623-count-number-of-trapezoids-i

Depth-First Search

0111-minimum-depth-of-binary-tree
0130-surrounded-regions
0144-binary-tree-preorder-traversal
0207-course-schedule
0210-course-schedule-ii
0329-longest-increasing-path-in-a-matrix
0463-island-perimeter
0529-minesweeper
0547-number-of-provinces
0637-average-of-levels-in-binary-tree
0662-maximum-width-of-binary-tree
0671-second-minimum-node-in-a-binary-tree
0684-redundant-connection
0721-accounts-merge
0733-flood-fill
0801-is-graph-bipartite
0820-find-eventual-safe-states
0871-keys-and-rooms
0881-loud-and-rich
0922-possible-bipartition
0960-minimize-malware-spread
1005-univalued-binary-tree
1315-sum-of-nodes-with-even-valued-grandparent
1507-check-if-there-is-a-valid-path-in-a-grid
1558-course-schedule-iv
2206-detonate-the-maximum-bombs

Breadth-First Search

0102-binary-tree-level-order-traversal
0111-minimum-depth-of-binary-tree
0130-surrounded-regions
0207-course-schedule
0210-course-schedule-ii
0329-longest-increasing-path-in-a-matrix
0463-island-perimeter
0529-minesweeper
0542-01-matrix
0547-number-of-provinces
0637-average-of-levels-in-binary-tree
0662-maximum-width-of-binary-tree
0684-redundant-connection
0721-accounts-merge
0733-flood-fill
0801-is-graph-bipartite
0820-find-eventual-safe-states
0871-keys-and-rooms
0922-possible-bipartition
0945-snakes-and-ladders
0960-minimize-malware-spread
1005-univalued-binary-tree
1036-rotting-oranges
1229-shortest-path-with-alternating-colors
1315-sum-of-nodes-with-even-valued-grandparent
1507-check-if-there-is-a-valid-path-in-a-grid
1558-course-schedule-iv
1876-map-of-highest-peak
2206-detonate-the-maximum-bombs

Matrix

0064-minimum-path-sum
0074-search-a-2d-matrix
0130-surrounded-regions
0329-longest-increasing-path-in-a-matrix
0463-island-perimeter
0529-minesweeper
0542-01-matrix
0733-flood-fill
0772-construct-quad-tree
0945-snakes-and-ladders
1036-rotting-oranges
1507-check-if-there-is-a-valid-path-in-a-grid
1876-map-of-highest-peak
2606-difference-between-ones-and-zeros-in-row-and-column

Union Find

0130-surrounded-regions
0547-number-of-provinces
0684-redundant-connection
0721-accounts-merge
0801-is-graph-bipartite
0922-possible-bipartition
0960-minimize-malware-spread
1032-satisfiability-of-equality-equations
1058-lexicographically-smallest-equivalent-string
1507-check-if-there-is-a-valid-path-in-a-grid
1706-min-cost-to-connect-all-points

Graph

0207-course-schedule
0210-course-schedule-ii
0329-longest-increasing-path-in-a-matrix
0547-number-of-provinces
0684-redundant-connection
0801-is-graph-bipartite
0820-find-eventual-safe-states
0871-keys-and-rooms
0881-loud-and-rich
0922-possible-bipartition
0960-minimize-malware-spread
1032-satisfiability-of-equality-equations
1039-find-the-town-judge
1229-shortest-path-with-alternating-colors
1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1514-path-with-maximum-probability
1558-course-schedule-iv
1706-min-cost-to-connect-all-points
2206-detonate-the-maximum-bombs
2976-minimum-cost-to-convert-string-i

Hash Table

0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0219-contains-duplicate-ii
0268-missing-number
0290-word-pattern
0347-top-k-frequent-elements
0448-find-all-numbers-disappeared-in-an-array
0721-accounts-merge
0960-minimize-malware-spread
1039-find-the-town-judge
2044-number-of-wonderful-substrings
3623-count-number-of-trapezoids-i

Divide and Conquer

0023-merge-k-sorted-lists
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements
0772-construct-quad-tree

Sorting

0215-kth-largest-element-in-an-array
0268-missing-number
0295-find-median-from-data-stream
0347-top-k-frequent-elements
0455-assign-cookies
0721-accounts-merge
1675-magnetic-force-between-two-balls
1930-maximum-number-of-consecutive-values-you-can-make
1962-single-threaded-cpu

Heap (Priority Queue)

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array
0295-find-median-from-data-stream
0347-top-k-frequent-elements
0789-kth-largest-element-in-a-stream
1514-path-with-maximum-probability
1762-furthest-building-you-can-reach
1955-seat-reservation-manager
1962-single-threaded-cpu

Bucket Sort

0347-top-k-frequent-elements

Counting

0347-top-k-frequent-elements

Quickselect

0215-kth-largest-element-in-an-array
0347-top-k-frequent-elements

Binary Search

0035-search-insert-position
0074-search-a-2d-matrix
0268-missing-number
0275-h-index-ii
0300-longest-increasing-subsequence
1335-maximum-candies-allocated-to-k-children
1675-magnetic-force-between-two-balls

Math

0067-add-binary
0070-climbing-stairs
0268-missing-number
1013-fibonacci-number
1236-n-th-tribonacci-number
1863-sum-of-all-subset-xor-totals
1922-count-good-numbers
2063-vowels-of-all-substrings
2206-detonate-the-maximum-bombs
2621-find-xor-beauty-of-array
2802-find-the-punishment-number-of-an-integer
3623-count-number-of-trapezoids-i

Bit Manipulation

0067-add-binary
0136-single-number
0201-bitwise-and-of-numbers-range
0268-missing-number
0338-counting-bits
0461-hamming-distance
0800-letter-case-permutation
1435-xor-queries-of-a-subarray
1863-sum-of-all-subset-xor-totals
2044-number-of-wonderful-substrings
2478-longest-nice-subarray
2533-bitwise-xor-of-all-pairings
2621-find-xor-beauty-of-array
3453-generate-binary-strings-without-adjacent-zeros

Topological Sort

0207-course-schedule
0210-course-schedule-ii
0329-longest-increasing-path-in-a-matrix
0820-find-eventual-safe-states
0881-loud-and-rich
1558-course-schedule-iv

Tree

0102-binary-tree-level-order-traversal
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0111-minimum-depth-of-binary-tree
0144-binary-tree-preorder-traversal
0637-average-of-levels-in-binary-tree
0662-maximum-width-of-binary-tree
0671-second-minimum-node-in-a-binary-tree
0772-construct-quad-tree
0789-kth-largest-element-in-a-stream
1005-univalued-binary-tree
1315-sum-of-nodes-with-even-valued-grandparent

Binary Tree

0102-binary-tree-level-order-traversal
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0111-minimum-depth-of-binary-tree
0144-binary-tree-preorder-traversal
0637-average-of-levels-in-binary-tree
0662-maximum-width-of-binary-tree
0671-second-minimum-node-in-a-binary-tree
0789-kth-largest-element-in-a-stream
1005-univalued-binary-tree
1315-sum-of-nodes-with-even-valued-grandparent

Dynamic Programming

0022-generate-parentheses
0032-longest-valid-parentheses
0064-minimum-path-sum
0070-climbing-stairs
0198-house-robber
0300-longest-increasing-subsequence
0329-longest-increasing-path-in-a-matrix
0338-counting-bits
0494-target-sum
0542-01-matrix
0746-min-cost-climbing-stairs
1013-fibonacci-number
1236-n-th-tribonacci-number
1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
2063-vowels-of-all-substrings
2140-solving-questions-with-brainpower

Simulation

0067-add-binary
2606-difference-between-ones-and-zeros-in-row-and-column

Geometry

2206-detonate-the-maximum-bombs
3623-count-number-of-trapezoids-i

Sliding Window

0219-contains-duplicate-ii
2478-longest-nice-subarray
2527-count-subarrays-with-fixed-bounds
3523-find-the-power-of-k-size-subarrays-ii

Queue

2527-count-subarrays-with-fixed-bounds

Monotonic Queue

2527-count-subarrays-with-fixed-bounds

Backtracking

0022-generate-parentheses
0093-restore-ip-addresses
0494-target-sum
0800-letter-case-permutation
1863-sum-of-all-subset-xor-totals
2456-construct-smallest-number-from-di-string
2802-find-the-punishment-number-of-an-integer
3453-generate-binary-strings-without-adjacent-zeros

Linked List

0023-merge-k-sorted-lists

Merge Sort

0023-merge-k-sorted-lists

Two Pointers

0295-find-median-from-data-stream
0455-assign-cookies

Design

0295-find-median-from-data-stream
0789-kth-largest-element-in-a-stream
1955-seat-reservation-manager

Data Stream

0295-find-median-from-data-stream
0789-kth-largest-element-in-a-stream

String

0022-generate-parentheses
0032-longest-valid-parentheses
0038-count-and-say
0067-add-binary
0093-restore-ip-addresses
0290-word-pattern
0721-accounts-merge
0800-letter-case-permutation
1032-satisfiability-of-equality-equations
1058-lexicographically-smallest-equivalent-string
2044-number-of-wonderful-substrings
2063-vowels-of-all-substrings
2456-construct-smallest-number-from-di-string
2976-minimum-cost-to-convert-string-i
3453-generate-binary-strings-without-adjacent-zeros

Stack

0032-longest-valid-parentheses
0144-binary-tree-preorder-traversal
2456-construct-smallest-number-from-di-string

Greedy

0455-assign-cookies
1762-furthest-building-you-can-reach
1930-maximum-number-of-consecutive-values-you-can-make
2456-construct-smallest-number-from-di-string

Memoization

0070-climbing-stairs
0329-longest-increasing-path-in-a-matrix
1013-fibonacci-number
1236-n-th-tribonacci-number

Prefix Sum

1435-xor-queries-of-a-subarray
2044-number-of-wonderful-substrings

Binary Search Tree

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

Minimum Spanning Tree

1706-min-cost-to-connect-all-points

Brainteaser

2533-bitwise-xor-of-all-pairings

Recursion

1013-fibonacci-number
1922-count-good-numbers

Combinatorics

1863-sum-of-all-subset-xor-totals
2063-vowels-of-all-substrings

Enumeration

1863-sum-of-all-subset-xor-totals

Shortest Path

1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1514-path-with-maximum-probability
2976-minimum-cost-to-convert-string-i

About

This repository contains my solutions to LeetCode problems, categorized by difficulty and topic. Each solution includes an optimized approach, time complexity analysis, and explanations where necessary. This serves as my personal DSA learning journey and interview preparation.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages