Skip to content

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.

Notifications You must be signed in to change notification settings

sidocoder/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

LeetCode Topics

Array

0074-search-a-2d-matrix
0130-surrounded-regions
0136-single-number
0215-kth-largest-element-in-an-array
0219-contains-duplicate-ii
0268-missing-number
0275-h-index-ii
0329-longest-increasing-path-in-a-matrix
0347-top-k-frequent-elements
0448-find-all-numbers-disappeared-in-an-array
0463-island-perimeter
0529-minesweeper
0542-01-matrix
0721-accounts-merge
0733-flood-fill
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
1675-magnetic-force-between-two-balls
1706-min-cost-to-connect-all-points
1762-furthest-building-you-can-reach
1876-map-of-highest-peak
1930-maximum-number-of-consecutive-values-you-can-make
1962-single-threaded-cpu
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
3523-find-the-power-of-k-size-subarrays-ii

Depth-First Search

0130-surrounded-regions
0207-course-schedule
0210-course-schedule-ii
0329-longest-increasing-path-in-a-matrix
0463-island-perimeter
0529-minesweeper
0547-number-of-provinces
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
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
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
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
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

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
1558-course-schedule-iv
1706-min-cost-to-connect-all-points
2206-detonate-the-maximum-bombs

Hash Table

0219-contains-duplicate-ii
0268-missing-number
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

Divide and Conquer

0023-merge-k-sorted-lists
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
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
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

0074-search-a-2d-matrix
0268-missing-number
0275-h-index-ii
1335-maximum-candies-allocated-to-k-children
1675-magnetic-force-between-two-balls

Math

0268-missing-number
2206-detonate-the-maximum-bombs
2621-find-xor-beauty-of-array
2802-find-the-punishment-number-of-an-integer

Bit Manipulation

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
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
0772-construct-quad-tree
0789-kth-largest-element-in-a-stream
1005-univalued-binary-tree

Binary Tree

0102-binary-tree-level-order-traversal
0789-kth-largest-element-in-a-stream
1005-univalued-binary-tree

Dynamic Programming

0022-generate-parentheses
0329-longest-increasing-path-in-a-matrix
0338-counting-bits
0542-01-matrix

Simulation

2606-difference-between-ones-and-zeros-in-row-and-column

Geometry

2206-detonate-the-maximum-bombs

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
0800-letter-case-permutation
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

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
0093-restore-ip-addresses
0721-accounts-merge
0800-letter-case-permutation
1032-satisfiability-of-equality-equations
1058-lexicographically-smallest-equivalent-string
2044-number-of-wonderful-substrings
2456-construct-smallest-number-from-di-string
3453-generate-binary-strings-without-adjacent-zeros

Stack

2456-construct-smallest-number-from-di-string

Greedy

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

Memoization

0329-longest-increasing-path-in-a-matrix

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

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages