Daily solutions to LeetCode's Top Interview 150 problems in C++ and Python
This repository contains my solutions to the LeetCode Top Interview 150 problems. The Top Interview 150 is a curated list of essential coding problems that cover the most common topics asked in technical interviews at top tech companies.
Goal: Solve all 150 problems and build a comprehensive reference for interview preparation.
- Total Problems: 150
- Solved: 36
- In Progress: 114
- Last Updated: February 17, 2026
.
├── README.md
├── problem_name.cpp # C++ solution
└── problem_name.py # Python solution
Each problem includes clean code in both C++ and Python
The Top Interview 150 covers these key topics:
- Array / String
- Two Pointers
- Sliding Window
- Matrix
- Hashmap
- Intervals
- Stack
- Linked List
- Binary Tree General
- Binary Tree BFS
- Binary Search Tree
- Graph General
- Graph BFS
- Trie
- Backtracking
- Divide & Conquer
- Kadane's Algorithm
- Binary Search
- Heap
- Bit Manipulation
- Math
- 1D DP
- Multidimensional DP
| # | Problem | Difficulty | C++ | Python | Topics |
|---|---|---|---|---|---|
| 3 | Longest Substring Without Repeating Characters | Medium | ✓ | ✓ | Hash Table, String, Sliding Window |
| 6 | Zigzag Conversion | Medium | ✓ | ✓ | String |
| 11 | Container With Most Water | Medium | ✓ | ✓ | Array, Two Pointers, Greedy |
| 12 | Integer to Roman | Medium | ✓ | ✓ | Hash Table, Math, String |
| 13 | Roman to Integer | Easy | ✓ | ✓ | Hash Table, Math, String |
| 14 | Longest Common Prefix | Easy | ✓ | ✓ | String |
| 15 | 3Sum | Medium | ✓ | ✓ | Array, Two Pointers, Sorting |
| 26 | Remove Duplicates from Sorted Array | Easy | ✓ | ✓ | Array, Two Pointers |
| 27 | Remove Element | Easy | ✓ | ✓ | Array, Two Pointers |
| 28 | Find the Index of the First Occurrence in a String | Easy | ✓ | ✓ | Two Pointers, String, String Matching |
| 30 | Substring with Concatenation of All Words | Hard | ✓ | ✓ | Hash Table, String, Sliding Window |
| 36 | Valid Sudoku | Medium | ✓ | ✓ | Array, Hash Table, Matrix |
| 42 | Trapping Rain Water | Hard | ✓ | ✓ | Array, Two Pointers, Dynamic Programming, Stack |
| 45 | Jump Game II | Medium | ✓ | ✓ | Array, Greedy, Dynamic Programming |
| 48 | Rotate Image | Medium | ✓ | ✓ | Array, Math, Matrix |
| 54 | Spiral Matrix | Medium | ✓ | ✓ | Array, Matrix, Simulation |
| 55 | Jump Game | Medium | ✓ | ✓ | Array, Greedy, Dynamic Programming |
| 58 | Length of Last Word | Easy | ✓ | ✓ | String |
| 68 | Text Justification | Hard | ✓ | ✓ | Array, String, Simulation |
| 76 | Minimum Window Substring | Hard | ✓ | ✓ | Hash Table, String, Sliding Window |
| 80 | Remove Duplicates from Sorted Array II | Medium | ✓ | ✓ | Array, Two Pointers |
| 88 | Merge Sorted Array | Easy | ✓ | ✓ | Array, Two Pointers |
| 121 | Best Time to Buy and Sell Stock | Easy | ✓ | ✓ | Array, Dynamic Programming |
| 122 | Best Time to Buy and Sell Stock II | Medium | ✓ | ✓ | Array, Greedy, Dynamic Programming |
| 125 | Valid Palindrome | Easy | ✓ | ✓ | Two Pointers, String |
| 134 | Gas Station | Medium | ✓ | ✓ | Array, Greedy |
| 135 | Candy | Hard | ✓ | ✓ | Array, Greedy |
| 151 | Reverse Words in a String | Medium | ✓ | ✓ | Two Pointers, String |
| 167 | Two Sum II - Input Array Is Sorted | Medium | ✓ | ✓ | Array, Two Pointers, Binary Search |
| 169 | Majority Element | Easy | ✓ | ✓ | Array, Hash Table, Divide and Conquer |
| 189 | Rotate Array | Medium | ✓ | ✓ | Array, Math, Two Pointers |
| 209 | Minimum Size Subarray Sum | Medium | ✓ | ✓ | Array, Binary Search, Sliding Window, Prefix Sum |
| 238 | Product of Array Except Self | Medium | ✓ | ✓ | Array, Prefix Sum |
| 274 | H-Index | Medium | ✓ | ✓ | Array, Sorting, Counting Sort |
| 380 | Insert Delete GetRandom O(1) | Medium | ✓ | ✓ | Array, Hash Table, Design |
| 392 | Is Subsequence | Easy | ✓ | ✓ | Two Pointers, String, Dynamic Programming |
- C++: Modern C++ (C++17/20) with STL
- Python: Python 3.x with clear, pythonic solutions
If you find this repository helpful, consider giving it a ⭐!
This project is open source and available under the MIT License.
Happy Coding! 💻✨