This repository contains my personal solutions to various Leetcode problems, all written in C++.
The purpose of this repo is to track progress, improve problem-solving skills, and serve as a reference for future revision or interview prep.
All solutions are placed in the root directory of the repository. Each file is named after the problem it solves, typically in the format:
<ProblemName>.cpp
Examples:
two_sum.cpplongest_substring_without_repeating_characters.cppmedian_of_two_sorted_arrays.cpp
Feel free to explore the code for each problem directly.
-
Clone the repository:
git clone https://github.com/ghostreindeer09/leetcode.git cd leetcode -
Compile and run any
.cppfile using a C++ compiler (e.g., g++):g++ two_sum.cpp -o two_sum ./two_sum
Make sure you have a C++17+ compatible compiler installed (like
g++orclang++).
⚠️ Note: Some files may contain just the core logic (e.g., class/function definitions) without amain()function. These are intended for use within the Leetcode online judge and may need amain()wrapper to run locally.
- Practice daily Leetcode problems
- Improve algorithmic thinking and C++ skills
- Build a searchable archive of solved problems
This is a personal project, but contributions in the form of suggestions, improvements, or discussion are welcome.
If you'd like to add your own solutions, feel free to fork the repo and open a pull request.
This project is licensed under the MIT License.