Welcome to the Hacktoberfest repository! π We're excited to have you participate and contribute to open-source projects. Please follow the guidelines outlined below to ensure a smooth and rewarding experience for everyone.
-
Contribute New Problems Only:
You can make a pull request only for a new problem statement. Solutions to already existing problems will be marked as invalid and rejected. -
Problem Source:
Problems can be taken from any reputable coding platform like CodeChef, CodeForces, LeetCode, HackerRank, etc. Please ensure you mention the source in your problem file. -
File Naming Convention:
- The file name should be the exact name of the question.
- If the question name contains spaces, replace the spaces with underscores (
_
). - Follow abbrev. CF - CodeForces, CC - CodeChef, LT - LeetCode, HR - Hackerrank, GFG - GeekForGeeks, etc
- Add the appropriate file extension based on the language used:
- For example, if the question is "Score More Buddy" on Codeforce, rename it as
CF_Score_More_Buddy.cpp
,CF_Score_More_Buddy.java
,CF_Score_More_Buddy.py
, orCF_Score_More_Buddy.c
based on the language of your choice.
- For example, if the question is "Score More Buddy" on Codeforce, rename it as
-
Adding the Problem Link:
- At the top of your code, include a link to the problem statement as a comment.
- This helps reviewers validate your solution and ensures the contribution adheres to the problem's context.
- Example:
// Problem Link: https://www.hackerrank.com/challenges/score-more-buddy/problem
-
Avoid Irrelevant Submissions:
- Any irrelevant contributions will be marked as spam and reported.
- Examples include multiple trivial changes, unrelated files, or repetitive solutions to simple problems.
If youβre new to GitHub and open-source contributions, follow these simple steps to get started:
-
Fork the Repository:
- Click the
Fork
button at the top right of this repository. - This creates a copy of the repository in your GitHub account.
- Click the
-
Clone the Repository:
- Clone the forked repository to your local machine using the following command:
git clone https://github.com/<your-username>/<repository-name>.git
- Replace
<your-username>
with your GitHub username and<repository-name>
with the name of this repository.
- Clone the forked repository to your local machine using the following command:
-
Add Your Solution:
- Create a new solution file following the file naming convention and include the problem link at the top as a comment.
-
Commit Your Changes:
- After adding the new file, commit your changes with a clear message:
git add . git commit -m "Added solution for <Question Name>"
- After adding the new file, commit your changes with a clear message:
-
Push to Your Forked Repository:
- Push your changes to your forked repository on the main branch (note: we use the
main
branch, notmaster
):git push origin main
- Push your changes to your forked repository on the main branch (note: we use the
-
Create a Pull Request (PR):
- Go to your forked repository on GitHub.
- Click on the
Compare & pull request
button. - Write a brief description of the problem and any other details relevant to the solution.
- Click on
Create Pull Request
.
-
Wait for Review:
- One of the maintainers will review your PR.
- If any changes are requested, update your code and commit the changes.
- Note: Keep an eye on the comments section of your PR for any feedback.
If you're new to Git and GitHub, here are some helpful resources to get you started:
-
Complete Git and GitHub Tutorial by Kunal Kushwaha:
Watch Now -
Complete Git And GitHub Tutorials (Hindi) by Krish Naik:
Watch Now
- Learn GitHub in 20 Minutes by Colt Steele:
Watch Now
- Git Cheat Sheet by GitHub Education:
Download PDF
Q: Can I contribute to the same question multiple times?
A: No, only new questions will be accepted. Solutions to the same question will be marked as invalid.
Q: What if my PR is marked as invalid?
A: Check the comments provided by the maintainer, rectify your solution, or add a new valid question.
Q: Can I contribute in multiple languages?
A: Yes, you can contribute in different programming languages, but ensure that each file follows the guidelines mentioned above.
Q: What branch should I use for contributions?
A: Always use the main
branch for pushing your final changes. Create separate branches for each feature/bug fix and then merge them into your main branch before pushing.
Happy Contributing! π»β¨
Note: This is a community-driven project. If you have any questions or need help, to reach out to the maintainers or other contributors. We're here to help you get started and make your first contribution a success! π