This folder contains competitive programming solutions organized by programming language. Each solution includes problem statement, approach explanation, and optimized code.
Programs/
├── C++/ # C++ solutions
├── Python/ # Python solutions
└── Java/ # Java solutions
Pick the language folder you're most comfortable with or want to learn:
- C++ - Most popular in competitive programming (fast execution)
- Python - Great for quick prototyping and readable code
- Java - Good balance of speed and OOP features
- Navigate to your language folder (C++, Python, or Java)
- Create a new file with a descriptive name (e.g.,
BinarySearch.cpp) - Include problem statement, approach, complexity analysis
- Add test cases to verify your solution
- Submit a pull request
-
Watermelon (
Watermelon.cpp) - Easy | Codeforces- Platform: Codeforces (4A)
- Topics: Math, Implementation
- Time: O(1), Space: O(1)
- Link: https://codeforces.com/problemset/problem/4/A
-
Team Olympiad (
TeamOlympiad.cpp) - Easy | Codeforces- Platform: Codeforces (490A)
- Topics: Greedy, Implementation
- Time: O(n), Space: O(n)
- Link: https://codeforces.com/problemset/problem/490/A
-
Next Round (
NextRound.cpp) - Easy | Codeforces- Platform: Codeforces (158A)
- Topics: Implementation
- Time: O(n), Space: O(n)
- Link: https://codeforces.com/problemset/problem/158/A
-
ATM (
ATM.cpp) - Easy | CodeChef- Platform: CodeChef (HS08TEST)
- Topics: Implementation, Conditions
- Time: O(1), Space: O(1)
- Link: https://www.codechef.com/problems/HS08TEST
-
Enormous Input Test (
EnormousInput.cpp) - Easy | CodeChef- Platform: CodeChef (INTEST)
- Topics: Fast I/O, Implementation
- Time: O(n), Space: O(1)
- Link: https://www.codechef.com/problems/INTEST
-
Turbo Sort (
TurboSort.cpp) - Easy | CodeChef- Platform: CodeChef (TSORT)
- Topics: Sorting
- Time: O(n log n), Space: O(n)
- Link: https://www.codechef.com/problems/TSORT
-
Sieve of Eranthoses (
sieveoferanthoses.cpp)- Topics: Number Theory
- Time: O(n log log n), Space: O(n)
- Link: Link: https://cp-algorithms.com/algebra/sieve-of-eratosthenes.html
-
Watermelon (
Watermelon.py) - Easy | Codeforces- Platform: Codeforces (4A)
- Topics: Math, Implementation
- Time: O(1), Space: O(1)
- Link: https://codeforces.com/problemset/problem/4/A
-
Next Round (
NextRound.py) - Easy | Codeforces- Platform: Codeforces (158A)
- Topics: Implementation
- Time: O(n), Space: O(n)
- Link: https://codeforces.com/problemset/problem/158/A
-
ATM (
ATM.py) - Easy | CodeChef- Platform: CodeChef (HS08TEST)
- Topics: Implementation, Conditions
- Time: O(1), Space: O(1)
- Link: https://www.codechef.com/problems/HS08TEST
-
Turbo Sort (
TurboSort.py) - Easy | CodeChef- Platform: CodeChef (TSORT)
- Topics: Sorting
- Time: O(n log n), Space: O(n)
- Link: https://www.codechef.com/problems/TSORT
-
Watermelon (
Watermelon.java) - Easy | Codeforces- Platform: Codeforces (4A)
- Topics: Math, Implementation
- Time: O(1), Space: O(1)
- Link: https://codeforces.com/problemset/problem/4/A
-
Next Round (
NextRound.java) - Easy | Codeforces- Platform: Codeforces (158A)
- Topics: Implementation
- Time: O(n), Space: O(n)
- Link: https://codeforces.com/problemset/problem/158/A
-
ATM (
ATM.java) - Easy | CodeChef- Platform: CodeChef (HS08TEST)
- Topics: Implementation, Conditions
- Time: O(1), Space: O(1)
- Link: https://www.codechef.com/problems/HS08TEST
-
Turbo Sort (
TurboSort.java) - Easy | CodeChef- Platform: CodeChef (TSORT)
- Topics: Sorting
- Time: O(n log n), Space: O(n)
- Link: https://www.codechef.com/problems/TSORT
We accept problems from these competitive programming platforms:
- ✅ Codeforces - https://codeforces.com/
- ✅ CodeChef - https://www.codechef.com/
- ✅ LeetCode - https://leetcode.com/
- ❌ No Generic/GFG problems - Must be from above platforms with valid problem links
-
Header Comment Block
/* Problem: [Problem Name] Platform: [Codeforces/CodeChef/LeetCode] Problem Code: [Problem Code/Number] Difficulty: [Easy/Medium/Hard] Link: [Direct Problem URL] Problem Statement: [Brief description] Example: Input: [sample input] Output: [sample output] Approach: [Your approach] Time Complexity: O(?) Space Complexity: O(?) Contributor: [Your GitHub Username] */
-
Clean, Well-Commented Code
- Use meaningful variable names
- Add comments for complex logic
- Follow language-specific conventions
-
Test Cases
- Include multiple test cases in main/test function
- Show expected output in comments
-
Complexity Analysis
- Explain time and space complexity
- Justify your approach
- Use descriptive filenames:
ProblemName.extension - Examples:
TwoSum.cpp,BinarySearch.py,MergeSort.java - Use PascalCase for problem names
- Easy: Basic data structures, simple algorithms
- Medium: Advanced DS, dynamic programming, graphs
- Hard: Complex algorithms, optimization techniques
- Start Simple: Begin with easy problems to understand the format
- Optimize: Always try to improve time/space complexity
- Test Thoroughly: Include edge cases in your tests
- Document Well: Clear explanations help others learn
- Follow Style: Match the coding style of existing solutions
Your contributions matter!
After your PR is accepted and merged:
- ✅ Your GitHub profile will be automatically added to our Contributors section
- ✅ Your contribution badge will appear on the repository
- ✅ You'll be featured in the domain leaderboard
- ✅ Multiple contributions earn you a spot in the Hall of Fame
Note: Badges and contributor recognition update automatically within 24 hours of PR merge. Make sure your commits are associated with your GitHub account!
- LeetCode - Practice problems
- Codeforces - Competitive contests
- HackerRank - Skill development
- GeeksforGeeks - Algorithms & DS
- CP-Algorithms - Algorithm references
- Check existing solutions for reference format
- Read the main CONTRIBUTING.md
- Open an issue if you have questions
- Join discussions in pull requests
Happy Coding! 🚀