- π― About the Repository
- π Repository Structure
- π€ How to Contribute
- π Code Base Guidelines
- π‘ Request a New Feature
- π₯ Contributors
- β Show Your Support
Welcome to Competitive Programming! π This repository is a growing collection of solutions to problems from platforms like HackerRank, LeetCode, GeeksForGeeks and more β written in multiple programming languages including Python, Java, C, C++, Go, and Rust.
Whether you are preparing for coding interviews πΌ, learning a new language π±, or just love solving problems π₯ β this is the place for you!
π£οΈ Want this repo to include problems in Go, Rust, or beginner-friendly challenges? Check out the Request a New Feature section!
Solutions are organized by platform or language. Here's how the repository is laid out:
Competitive-Programming/
βββ C/ # C solutions (HackerRank & more)
βββ C++/ # C++ solutions (HackerRank & more)
βββ Java/ # Java solutions (HackerRank & more)
βββ Python/ # Python solutions (HackerRank, MLH & more)
βββ Leetcode/ # Solutions organized by LeetCode problem number
βββ GeeksForGeeks/ # GeeksForGeeks problem solutions
βββ Neetcode/ # NeetCode roadmap solutions
βββ Interview Question/ # Common interview questions
βββ InterviewKit-HackerRank/ # HackerRank interview preparation kit
Thanks for your interest in contributing! π Follow the steps below to submit your first Pull Request (PR).
First, fork the repository, and star it if you like β. To contribute, create a local copy of the repository by running the following command in your terminal:
git clone https://github.com/<your-username>/Competitive-ProgrammingEnsure to replace your-username with your GitHub username. You must fork the repository before cloning it.
Once cloned, navigate to the repository directory:
cd Competitive-ProgrammingNow, create a new branch to make your changes. Name the branch after your username:
git checkout -b <your-branch-name>Replace your-branch-name with your desired branch name, preferably your username, to avoid conflicts.
Add your solution in any programming language. Be sure to:
- β Optimize the code as much as possible.
- β Include comments to improve readability.
- β Place the file in the correct folder (see Repository Structure).
After making changes, sync them to the repository. Start by adding all changes:
git add .Now, commit your changes with a descriptive message:
git commit -m "ADD YOUR MESSAGE HERE (E.g., SOLVED HACKERRANK PROBLEM)"Commit messages should describe where the problem was solved, like "FROM HACKERRANK" or "FROM LEETCODE". Use all caps for platform names.
Next, push your changes to your branch:
git push --set-upstream origin <your-branch-name>Then, add the upstream remote repository:
git remote add upstream https://github.com/chaudharypraveen98/Competitive-ProgrammingPeriodically, sync your fork with the upstream repository to stay updated:
git fetch upstream
git checkout master
git merge upstream/masterOnce your changes are ready, go to your forked repository and click on New Pull Request. Follow the on-screen instructions to complete the PR submission.
Congratulations! π₯³ You've successfully created a Pull Request!
Lastly, don't forget to check if there is a relevant open issue for your contribution β if so, link your PR to it!
To keep the codebase clean and consistent, please follow these rules:
| Rule | Description |
|---|---|
| π¬ Comments | Add comments on a new line to explain your code. |
| ποΈ Structure | Follow the standard structure for the programming language. |
| π Location | Upload files inside the folder matching the language/platform (e.g., Java/Hackerrank for an algorithm implementation in Java). |
Missing something you'd love to see here? π€ We'd be happy to add it!
Please open an issue describing the feature you'd like to see in this repository, for example:
- πΉ A dedicated section for Go problems
- π¦ Solutions in Rust
- π± A collection of beginner-friendly problems
- β Any other idea that can improve this repo!
π Open a new issue here and we'll discuss it together!
A huge thank you to everyone who has contributed! π
π Want to see who solved what? Check out the full list in CONTRIBUTORS.md.
π‘ To get added, open a Pull Request with your solution β we'll add you automatically! π
If you find this repository helpful, please give it a star β β it really helps!
