Skip to content

Repository files navigation

tests release Quality Gate Status Security Rating Vulnerabilities codecov pypi downloads python Star ⭐ Sponsor 💖

leetcode-py logo

leetcode-py

A Python package to generate professional LeetCode practice environments: a problem README, a typed solution stub, a parametrized pytest suite with 10+ cases, helpers, and a playground notebook, all from JSON templates. Full documentation lives at leetcode-py.wisl.dev.

What makes this different:

  • 🤖 LLM-Assisted Workflow: Generate new problems instantly with AI assistance
  • 🎨 Visual Debugging: TreeNode, ListNode, and GraphNode render as Graphviz diagrams in Jupyter and clean ASCII in the terminal
  • 🧪 Production Testing: Comprehensive test suites with edge cases and reproducibility verification
  • 🚀 Modern Python: PEP 585/604 type hints, uv, and professional tooling
  • 📊 Quality Assurance: 95%+ test coverage, security scanning, automated linting
  • Powerful CLI: Generate problems anywhere with lcpy command

🚀 Quick Start

Requires Python 3.10+ and Graphviz for visualizations (install guide).

# Install the package
pip install leetcode-py-sdk

# Generate problems anywhere
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

# Start practicing
cd leetcode/two_sum
python -m pytest test_solution.py  # Run tests
# Edit solution.py, then rerun tests

See the Quickstart for the full walkthrough and the CLI guide for every option.

🗂️ Collections

531 problems, ready to generate, across seven complete collections. Browse them all in the [catalog](https://leetcode-py.wisl.dev/catalog):
Collection What it is
Grind 75 Essential coding interview questions, time-boxed study plan
Grind 169 problems; Grind 75 plus the extended edition
Blind 75 The original curated list
NeetCode 150 Comprehensive coverage by topic
NeetCode 250 NeetCode 150 plus 100 more
NeetCode All The complete neetcode.io list; coverage still growing
AlgoMaster 75 Curated algorithmic mastery problems

🛠️ Development

git clone https://github.com/wislertt/leetcode-py.git
cd leetcode-py
uv sync
bake test

Problems in leetcode/ are generated from JSON templates. To add one, use the LLM-assisted workflow; for repo tasks see the bakefile guide.

📖 Documentation

💖 Support This Project

If you find this project helpful, please consider starring the repo ⭐ or sponsoring my work 💖.

Star ⭐ Sponsor 💖

License

Apache-2.0. See LICENSE.

About

Python LeetCode practice environment with automated problem generation, data structure visualizations, and comprehensive testing. Includes all Grind 75, partial Blind, Neetcode and Algomaster problems with enhanced TreeNode/ListNode helpers, CI/CD pipeline, and LLM-assisted problem creation.

Topics

Resources

Contributing

Stars

140 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages