This repository contains solutions to various algorithm problems with detailed documentation and tests.
algorithms-python/
├── docs/ # Documentation for each problem
│ └── problem-name.md
├── src/ # Source code organized by categories
│ ├── dynamic/ # Dynamic programming problems
│ ├── graphs/ # Graph-related problems
│ ├── math/ # Mathematical problems
│ ├── searching/ # Searching algorithms
│ ├── sorting/ # Sorting algorithms
│ └── strings/ # String manipulation problems
└── tests/ # Test cases for each solution
Each problem includes:
-
A markdown file in the
docs/
directory explaining:- Problem description
- Algorithm design
- Input/Output specifications
- Constraints
- Solution approach
- Time and space complexity
-
Implementation in the appropriate category directory under
src/
-
Test cases in the
tests/
directory
-
Create a virtual environment:
uv venv source .venv/bin/activate
-
Install dependencies listed in
pyproject.toml
:uv sync
-
Run tests:
pytest tests/
-
Format and lint code:
black src/ tests/ isort src/ tests/
When adding a new problem solution:
- Create documentation in
docs/
- Implement solution in appropriate category in
src/
- Add comprehensive tests in
tests/
- Ensure all tests pass before submitting