A structured exploration of data structures and algorithms with detailed notes on problem-solving logic, complexity analysis, and design patterns for computational thinking.
This repository contains solutions to LeetCode problems, organized following the NeetCode Roadmap structure for systematic algorithm learning.
| # | Topic | Description |
|---|---|---|
| 01 | Arrays and Hashing | Array manipulation, hash tables, sorting algorithms |
| 02 | Two Pointers | Two pointer technique for array/string problems |
| 03 | Stack | Stack and Queue data structures, monotonic stack |
| 04 | Binary Search | Binary search algorithm and variations |
| 05 | Sliding Window | Sliding window technique for substring/subarray problems |
| 06 | Linked List | Singly and doubly linked list operations |
| 07 | Trees | Binary trees, BST, tree traversals |
| 08 | Tries | Prefix trees for string operations |
| 09 | Backtracking | Recursive backtracking algorithms |
| 10 | Heap / Priority Queue | Heap data structure and priority queues |
| 11 | Graphs | Graph traversal (BFS, DFS), basic graph algorithms |
| 12 | 1D Dynamic Programming | One-dimensional dynamic programming |
| 13 | Intervals | Interval scheduling and merging problems |
| 14 | Greedy | Greedy algorithm strategies |
| 15 | Advanced Graphs | Advanced graph algorithms (Dijkstra, Union-Find, etc.) |
| 16 | 2D Dynamic Programming | Two-dimensional dynamic programming |
| 17 | Bit Manipulation | Bitwise operations and tricks |
| 18 | Math and Geometry | Mathematical algorithms and geometric problems |
- 98. Validate Binary Search Tree - Valid Range DFS
- 100. Same Tree - Recursive DFS
- 102. Binary Tree Level Order Traversal - BFS Template
- 104. Maximum Depth of Binary Tree - DFS/BFS comparison
- 105. Construct Binary Tree from Preorder and Inorder Traversal - Tree Construction
- 110. Balanced Binary Tree - Bottom-up DFS
- 124. Binary Tree Maximum Path Sum - Hard, Arch vs Straight Path
- 144. Binary Tree Preorder Traversal
- 145. Binary Tree Postorder Traversal - Visit Flag Technique
- 173. Binary Search Tree Iterator
- 199. Binary Tree Right Side View - BFS Last Element
- 226. Invert Binary Tree - DFS/BFS comparison
- 230. Kth Smallest Element in a BST - Inorder = Sorted
- 235. Lowest Common Ancestor of a BST - BST Split Point
- 297. Serialize and Deserialize Binary Tree - Hard, Preorder + Null Markers
- 543. Diameter of Binary Tree - Return height, track diameter
- 572. Subtree of Another Tree - Double Recursion
- 1448. Count Good Nodes in Binary Tree - Path Maximum
- 2. Add Two Numbers
- 19. Remove Nth Node From End of List
- 21. Merge Two Sorted Lists
- 23. Merge k Sorted Lists - Hard
- 25. Reverse Nodes in k-Group - Hard
- 138. Copy List with Random Pointer
- 141. Linked List Cycle
- 143. Reorder List
- 146. LRU Cache
- 148. Sort List
- 206. Reverse Linked List
- 287. Find the Duplicate Number - Floyd's Cycle Detection
- 707. Design Linked List
- 876. Middle of the Linked List
- 1472. Design Browser History
- 3. Longest Substring Without Repeating Characters
- 121. Best Time to Buy and Sell Stock
- 424. Longest Repeating Character Replacement
- 1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold
- 4. Median of Two Sorted Arrays - Hard
- 33. Search in Rotated Sorted Array
- 74. Search a 2D Matrix
- 153. Find Minimum in Rotated Sorted Array
- 278. First Bad Version
- 704. Binary Search
- 981. Time Based Key-Value Store
- 20. Valid Parentheses
- 227. Basic Calculator II
- 496. Next Greater Element I
- 622. Design Circular Queue
- 641. Design Circular Deque
- 739. Daily Temperatures
- 853. Car Fleet
- 1700. Number of Students Unable to Eat Lunch
- 11. Container With Most Water
- 15. 3Sum
- 26. Remove Duplicates from Sorted Array
- 88. Merge Sorted Array
- 167. Two Sum II - Input Array Is Sorted
- 349. Intersection of Two Arrays
- 1. Two Sum
- 28. Find the Index of the First Occurrence in a String
- 128. Longest Consecutive Sequence
- 217. Contains Duplicate
- 242. Valid Anagram
- 506. Relative Ranks
- 724. Find Pivot Index
- 912. Sort an Array
- 1122. Relative Sort Array
Each problem is organized in its own folder with:
solution.py- Solution code with multiple approaches when applicableREADME.md- Problem description, algorithm explanation, complexity analysis, and key concepts
├── 01-Arrays-and-Hashing/
│ ├── 1. Two Sum/
│ │ ├── solution.py
│ │ └── README.md
│ └── ...
├── 02-Two-Pointers/
│ └── ...
└── ...
- Follow the Roadmap: Start from
01-Arrays-and-Hashingand progress sequentially - Read the Notes: Each problem folder contains solution code and detailed explanations
- Practice: Try solving problems before looking at solutions
- Review: Revisit completed topics to reinforce learning
- LeetCode - All problems in this repository are sourced from LeetCode
- NeetCode Roadmap - Structured approach to mastering coding interviews
- NeetCode 150 - Curated list of 150 essential problems
- Language: Python 3.x
- Package Manager: uv
This project is licensed under the terms specified in the LICENSE file.