You can contribute to this repo in any of the following ways
-
If you are selecting a problem from a website like hackerrank, codechef etc
- Add it to the respective folder (eg: hackerrank_problems; if it doesn't exist, create it)
- Make a folder with the name as name of the problem given
- Should have 2 files:
problem.md
andsolution
- Add the link to the problem in
problem.md
file - Add your solution in any language
- Solutions must be properly indented and explained with comments
-
If you are submitting a new problem
- Add it to misc folder (if it doesn't exist, create it)
- Make a folder with name as name of the problem
- Should have 2 files:
problem.md
andsolution
- In
problem.md
, provide detailed explanation of problem statement and constraints with at least 2 testcases and it's explanation - Add your solution in any language
- Solutions must be properly indented and explained with comments
- You can contribute your solutions to any problem
- Add it as a new file in the format solution_number eg: (
solution2
) in the respective problem folder - Solutions must be properly indented and explained with comments
- You can improve the readme and contributing documentation
The idea is to collect different solutions/logic in different languages to some of the popular CP questions.
Read the following points carefully
- The
problem
file should only contain either the link to the problem OR the problem itself. DON'T add anything related to the solution in theproblem
file. - In your
solution
, ADD THE LOGIC USED FOR SOLVING IN THE FORM OF COMMENTS EITHER ALONG WITH THE CODE or AT THE BEGINNING OF THE CODE. - The logic MUST be in the
solution
file and NOT inproblem
file - More emphasis is given on understanding the logic used to get the solution rather than the code itself. Hence simply copy-pasting code is not encouraged.
As long as your PR adheres with all the points mentioned above, you're good to go ✨
Happy contributing 😃