Thank you for your interest in contributing to this DSA Practice Repository! 🎉
- Fork the repository and create a new branch
- Add your solution in the appropriate topic folder
- Follow the naming convention:
problem_name.py - Include documentation:
""" Problem: [Problem Name] Approach: [Brief description of your approach] Time Complexity: O(...) Space Complexity: O(...) Example: Input: ... Output: ... """
- Test your code with edge cases
- Submit a pull request with a clear description
- Use descriptive variable names
- Add comments for complex logic
- Follow PEP 8 Python style guide
- Keep functions modular and clean
- Include time and space complexity analysis
If you're adding an important interview problem:
- Suffix the filename with
_IMP(e.g.,MaxSumSubArr_IMP.py) - Ensure the solution is optimal
- Include multiple approaches if applicable
- Add detailed comments
"""
Problem: Problem Name Here
Topic: [Topic Name]
Approach:
- Describe your algorithm
- Mention time/space complexity
- Explain key insights
Time Complexity: O(n)
Space Complexity: O(1)
"""
def solution(input_data):
"""
Detailed docstring explaining the function.
Args:
input_data: Description of input
Returns:
Description of output
"""
# Implementation here
pass
# Test cases
if __name__ == "__main__":
# Example test case
assert solution(test_input) == expected_output
print("All tests passed!")- ✅ New problem solutions
- ✅ Alternative/optimized approaches
- ✅ Bug fixes in existing code
- ✅ Better explanations/comments
- ✅ Performance improvements
- ✅ Documentation improvements
- ✅ Test cases for existing problems
- ❌ Don't add brute force solutions without optimization
- ❌ Don't skip time/space complexity analysis
- ❌ Don't add incomplete or untested code
- ❌ Don't duplicate existing solutions without significant improvement
- ❌ Don't add solutions in other languages (Python only)
- Update your branch with the latest main branch
- Ensure all code is tested and working
- Write a clear PR title and description
- Reference any related issues (if applicable)
- Wait for review - Maintainers will provide feedback if needed
- Found a bug? Create an issue with:
- Problem filename
- Description of the issue
- Expected vs actual behavior
- Your environment (Python version, OS)
- Be respectful and constructive
- Help others learn and improve
- Share your knowledge freely
- Celebrate each contribution
Open an issue or discussion if you have questions about:
- Algorithm approaches
- How to solve a problem
- Code improvements
- Repository structure
Thank you for making this repository better! 🚀