Welcome to my LeetCode Solutions repository! This repository contains my solutions to various coding problems from LeetCode, a platform for practicing coding interviews. By sharing my solutions publicly, I aim to contribute to the learning and collaboration within the programming community.
LeetCode is an excellent resource for sharpening your coding skills and preparing for technical interviews. This repository is organized by problem number and name, and each solution includes explanations and comments where applicable. My goal is to provide clear and concise solutions to help others understand different approaches to solving these problems.
The repository is structured as follows:
- Each problem is stored in a directory named with the problem number and title.
- Each problem directory contains:
- The solution file (e.g.,
solution.cpp
) - A
README.md
file with a detailed explanation of the problem and the solution
- The solution file (e.g.,
Each solution is provided in a separate file and follows this format:
- Filename:
solution.cpp
- Docstring: A brief description of the problem
- Code: The C++ code solving the problem
- Comments: Inline comments explaining key parts of the solution
Additionally, each problem directory includes a README.md
file with:
- A restatement of the problem
- Explanation of the approach and logic used in the solution
- Time and space complexity analysis
-
Clone the repository:
git clone https://github.com/satendra03/LeetCode.git cd LeetCode
-
Navigate to the solution of interest:
cd solutions/0001 - Two Sum
-
Compile and run the solution:
Each solution can be compiled and run using a C++ compiler. For example:
g++ solution.cpp -o solution ./solution
Contributions are welcome! If you have a better solution or additional problems to add, please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Commit your changes (
git commit -am 'Add new solution or improve existing one'
) - Push to the branch (
git push origin feature-branch
) - Create a new Pull Request
If you have any questions, suggestions, or feedback, feel free to reach out to me:
- LeetCode: satendra_03
- GitHub: satendra03
- Email: [email protected]
Happy coding! 😊