Automate your LeetCode journey with Python and smart problem generation.
Project details
Leetcode-py offers a comprehensive Python environment for tackling LeetCode problems. With features like automated problem generation, data structure visualizations, and integrated CI/CD, it's designed for optimized practicing. Gain an edge with enhanced helpers for complex data structures and access a structured collection of essential coding challenges.
LeetCode practice made efficient and accessible through a powerful Python package designed to generate a complete coding environment. The package facilitates the creation of problem README files, typed solution stubs, and parameterized pytest suites containing over 10 test cases, all derived from JSON templates. Additional features include helper functions and a dedicated playground notebook to enhance the coding experience. Comprehensive documentation is available at leetcode-py.wisl.dev.
lcpy command allows problem generation from any environment, enhancing usability. Further details are provided in the CLI documentation.Requirements include Python 3.10+ along with Graphviz for visualizations, with the installation instructions documented in the repository.
# Install the package
pip install leetcode-py-sdk
# Generate problems
lcpy gen -n 1 # Generate Two Sum
lcpy gen -t grind-75 # Generate all Grind 75 problems
lcpy list -t blind-75 # List Blind 75 problems
# Begin coding practice
cd leetcode/two_sum
python -m pytest test_solution.py # Execute tests
# Modify solution.py, then rerun tests
The repository boasts 1404 problems available for exploration, organized into several curated collections. Review the complete list in the catalog:
| Collection | Description |
|---|---|
| Grind 75 | Essential coding interview questions for time-focused study |
| Grind | 169 problems; includes Grind 75 plus the extended collection |
| Blind 75 | The original expertly curated list |
| NeetCode 150 | Comprehensive problems organized by topic |
| NeetCode 250 | NeetCode 150 plus an additional 100 problems |
| NeetCode All | The complete list from neetcode.io; continually expanding |
| AlgoMaster 75 | Specialized algorithm mastery problems |
Development contributions are welcome. Clone the repository to get started:
git clone https://github.com/wislertt/leetcode-py.git
cd leetcode-py
uv sync
bake test
Problems are generated from JSON templates, and detailed instructions for adding new problems are found in the LLM-assisted workflow and bakefile guide.
If this project proves beneficial, consider starring the repository or supporting its development.
Comments
0Start the conversation
Share the first comment.