๐Ÿค Open Source Contributions

Contribute a Problem

Suggest a problem idea or contribute directly via GitHub Pull Request. We review every submission and guide you through the process.

๐Ÿ’ก Suggest a Problem

Don't have time to write the full PR? Just fill this out โ€” we'll review it and reach out via GitHub.

๐Ÿ”ง Contribute via GitHub PR

Want full credit? Follow this guide to add the problem directly โ€” we'll review and merge your PR!

1
๐Ÿด Fork the Repository

Start by forking the CodePro GitHub repository to your own account.

# Click 'Fork' on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/code-pro.git
cd code-pro
2
๐Ÿ“ Create a Problem Folder

Inside scripts/problems/, create a folder with your problem's slug.

mkdir scripts/problems/your-problem-slug
cd scripts/problems/your-problem-slug
3
๐Ÿ“ Write structure.md

Define the function signature, parameter types, and return type. Our generator will auto-create boilerplates for C++, JS, and Rust.

# structure.md
# function: twoSum
## params
- nums: int[]
- target: int
## return
- int[]
4
๐Ÿ“„ Write description.md

Write the full problem statement in Markdown โ€” examples, constraints, all of it.

# Two Sum

Given an array of integers **nums** and an integer **target**, 
return indices of the two numbers such that they add up to target.

## Examples
```
Input: nums = [2,7,11,15], target = 9
Output: [0,1]
```

## Constraints
- 2 โ‰ค nums.length โ‰ค 10โด
5
๐Ÿงช Add Test Cases

Create a testcases/ folder with numbered .txt files (input and expected output).

testcases/
โ”œโ”€โ”€ 1.in  โ†’ "4\n2 7 11 15\n9"
โ”œโ”€โ”€ 1.out โ†’ "0 1"
โ”œโ”€โ”€ 2.in  โ†’ "3\n3 2 4\n6"
โ””โ”€โ”€ 2.out โ†’ "1 2"
6
โš™๏ธ Run the Generator

Use our script to auto-generate boilerplates and validate everything.

# From repo root:
npm run generate --problem=your-problem-slug

# This outputs partial boilerplate (shown to users)
# and full boilerplate (reads stdin, calls your func)
7
๐Ÿš€ Open a Pull Request

Push your branch and open a PR. Reference your suggestion ID in the title so we can track it.

git checkout -b add/your-problem-slug
git add scripts/problems/your-problem-slug/
git commit -m "feat: add 'Your Problem Title' problem"
git push origin add/your-problem-slug
# Then open a PR on GitHub!
โญ
Ready to contribute?

Contributors get their GitHub handle listed on the problem page permanently.

Open GitHub Repo โ†’