A well-organized collection of solutions for NeetCode 150 and LeetCode problems covering all major Data Structures & Algorithms topics. All solutions are written in C++ with detailed explanations, complexity analysis, and example test cases.
.
├── Arrays_and_Hashing/
├── Two_Pointers/
├── Sliding_Window/
├── Stack/
├── Binary_Search/
├── Linked_List/
├── Trees/
├── Tries/
├── Heap_Priority_Queue/
├── Backtracking/
├── Graphs/
├── Dynamic_Programming/
├── Greedy/
├── Intervals/
├── Math_and_Geometry/
└── Bit_Manipulation/
| # | Title | Difficulty |
|---|---|---|
| 1 | Two Sum | Easy |
| 49 | Group Anagrams | Medium |
| 128 | Longest Consecutive Sequence | Medium |
| 217 | Contains Duplicate | Easy |
| 238 | Product of Array Except Self | Medium |
| 242 | Valid Anagram | Easy |
| 347 | Top K Frequent Elements | Medium |
| # | Title | Difficulty |
|---|---|---|
| 11 | Container With Most Water | Medium |
| 15 | 3Sum | Medium |
| 125 | Valid Palindrome | Easy |
| 167 | Two Sum II | Medium |
| # | Title | Difficulty |
|---|---|---|
| 3 | Longest Substring Without Repeating Characters | Medium |
| 121 | Best Time to Buy and Sell Stock | Easy |
| 424 | Longest Repeating Character Replacement | Medium |
| # | Title | Difficulty |
|---|---|---|
| 20 | Valid Parentheses | Easy |
| 155 | Min Stack | Medium |
| 739 | Daily Temperatures | Medium |
| # | Title | Difficulty |
|---|---|---|
| 33 | Search in Rotated Sorted Array | Medium |
| 153 | Find Minimum in Rotated Sorted Array | Medium |
| 704 | Binary Search | Easy |
| # | Title | Difficulty |
|---|---|---|
| 21 | Merge Two Sorted Lists | Easy |
| 141 | Linked List Cycle | Easy |
| 206 | Reverse Linked List | Easy |
| # | Title | Difficulty |
|---|---|---|
| 100 | Same Tree | Easy |
| 104 | Maximum Depth of Binary Tree | Easy |
| 226 | Invert Binary Tree | Easy |
| 235 | Lowest Common Ancestor of BST | Medium |
| # | Title | Difficulty |
|---|---|---|
| 208 | Implement Trie (Prefix Tree) | Medium |
| # | Title | Difficulty |
|---|---|---|
| 215 | Kth Largest Element in an Array | Medium |
| 295 | Find Median from Data Stream | Hard |
| # | Title | Difficulty |
|---|---|---|
| 39 | Combination Sum | Medium |
| 78 | Subsets | Medium |
| # | Title | Difficulty |
|---|---|---|
| 133 | Clone Graph | Medium |
| 200 | Number of Islands | Medium |
| # | Title | Difficulty |
|---|---|---|
| 70 | Climbing Stairs | Easy |
| 198 | House Robber | Medium |
| 300 | Longest Increasing Subsequence | Medium |
| 322 | Coin Change | Medium |
| # | Title | Difficulty |
|---|---|---|
| 53 | Maximum Subarray | Medium |
| 55 | Jump Game | Medium |
| # | Title | Difficulty |
|---|---|---|
| 56 | Merge Intervals | Medium |
| 57 | Insert Interval | Medium |
| # | Title | Difficulty |
|---|---|---|
| 48 | Rotate Image | Medium |
| 50 | Pow(x, n) | Medium |
| # | Title | Difficulty |
|---|---|---|
| 191 | Number of 1 Bits | Easy |
| 338 | Counting Bits | Easy |
Each solution file is standalone and can be compiled and executed:
g++ -std=c++17 Arrays_and_Hashing/1_two_sum.cpp -o solution
./solutionEvery solution file includes:
- Problem statement with examples and constraints
- Approach explanation in comments
- Time & Space Complexity analysis
- Clean C++ implementation
- Runnable test cases in the
main()function
| Badge | Meaning |
|---|---|
| Easy | Foundational problems |
| Medium | Core DSA patterns |
| Hard | Advanced techniques |