Welcome to the LeetCode Solutions Repository! This open-source project is dedicated to providing solutions, explanations, and problem statements for various LeetCode questions. We encourage developers and problem solvers to contribute and collaborate.
- Fork this repository to your GitHub account.
- Clone your forked repository locally:
git clone https://github.com/your-username/Leetcode-Solutions.git
- Create a new branch for your changes:
git checkout -b feature/your-solution
- Solve a LeetCode problem and add your solution to the respective directory (e.g.,
problems/leetcode-problem-name/
). Please adhere to the following naming convention:- The solution file:
leetcode-question-number-question-name.cpp
(e.g.,1234-example-problem.cpp
). - The Notes.md file:
Notes.md
(for describing your thinking approach). - The Readme.md file:
Readme.md
(for the problem statement).
- The solution file:
- Add comments and explanations to your code for clarity.
- Commit your changes:
git commit -m "Add solution for LeetCode problem-name"
- Push the changes to your fork:
git push origin feature/your-solution
- Create a pull request to merge your changes into the main repository.
For a streamlined contribution process, you can use the LeetHub extension, which automatically follows the code of conduct mentioned above. It will help you create pull requests with the correct file structure.
If you find existing solutions that can be improved or made more understandable:
- Follow steps 1 and 2 from the "Adding Solutions" section.
- Make improvements to the code or documentation.
- Commit your changes with a clear message.
- Push the changes to your fork.
- Create a pull request to merge your improvements.
Feel free to participate in discussions, provide feedback on existing solutions, and help other contributors.
Please adhere to our Code of Conduct to ensure a welcoming and inclusive environment for all contributors. The code of conduct is as follows:
- File name of the pull request should be:
leetcode-question-number-question-name
- Each pull request should contain three files:
- The solution of the problem with the proper extension (e.g.,
leetcode-question-number-question-name.cpp
). Notes.md
file, which describes your thinking approach and a rough sketch of your solution.Readme.md
, which is the problem statement of the question.
- The solution of the problem with the proper extension (e.g.,
To achieve this easily, you can use the LeetHub extension, which will add your submitted solution to your forked GitHub repository and follow the above code of conduct automatically.
- Fork this repository.
- Clone your forked repository.
- Follow the contribution guidelines above.
- Join our community and start contributing to improve this resource!
Thank you for being a part of this collaborative effort to build a valuable resource for problem solvers!