A collection of my solutions to the NeetCode 150 problems, implemented in C++.
This repository documents my journey of strengthening my understanding of data structures, algorithms, problem-solving techniques, and computational complexity.
The goal is not simply to solve 150 problems, but to develop a deeper understanding of why algorithms work, how to optimize them, and when to use different approaches.
- Develop strong foundations in data structures and algorithms.
- Improve algorithmic thinking and problem-solving skills.
- Understand time and space complexity using Big-O notation.
- Explore brute-force solutions before progressing toward optimized approaches.
- Practice writing clean, efficient, and maintainable C++ code.
- Prepare for technical interviews and software engineering internships.
For each problem, I aim to follow a structured process:
- Understand: Identify the problem requirements, constraints, and edge cases.
- Brute Force: Develop a straightforward solution to establish correctness.
- Analyze: Determine the time and space complexity.
- Optimize: Explore more efficient algorithms and data structures.
- Implement: Write a clean and readable C++ solution.
- Test: Verify correctness using sample inputs and edge cases.
- Document: Record important insights and lessons learned.
Solutions may include comments documenting their computational complexity.
// Time Complexity: O(n)
// Space Complexity: O(1)
Where applicable, I will document the trade-offs between different approaches.
My focus is on understanding algorithms rather than memorizing solutions.
I aim to answer three questions for every problem:
- Correctness: Why does this algorithm produce the correct result?
- Efficiency: What are its time and space complexities?
- Optimization: Can the problem be solved more efficiently?
All solutions are written for educational purposes and personal practice. Some problems may contain multiple approaches as I explore different algorithms and optimizations.
Consistency over memorization. Understanding over shortcuts.