> ## Documentation Index
> Fetch the complete documentation index at: https://leetcode-py.wisl.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> leetcode-py is a Python LeetCode practice environment generator with one CLI: lcpy. It is not a service or platform.
> Each problem is a directory under leetcode/ with README.md, solution.py, test_solution.py, helpers.py, and playground.ipynb. lcpy gen creates them from JSON templates bundled with the package.
> Examples are backed by tests; copy them verbatim.

# LeetCode Practice Environments in Python

> Generate tested Python LeetCode practice environments: problem README, typed solution stub, parametrized pytest suite, and playground notebook per problem.

![leetcode-py: Modern Python LeetCode practice environment.](https://mintcdn.com/leetcode-py/aJKJ4BOUnXP-zM3G/img/brand/og-card-light.png?fit=max\&auto=format\&n=aJKJ4BOUnXP-zM3G\&q=85\&s=54a04289c0ca462f68fd1574d8510e7c)

![leetcode-py: Modern Python LeetCode practice environment.](https://mintcdn.com/leetcode-py/aJKJ4BOUnXP-zM3G/img/brand/og-card-dark.png?fit=max\&auto=format\&n=aJKJ4BOUnXP-zM3G\&q=85\&s=87bdcdcd4405e129efdcf41ff708f890)

[![tests](https://img.shields.io/github/actions/workflow/status/wislertt/leetcode-py/cd.yml?branch=main\&label=tests\&logo=github)](https://github.com/wislertt/leetcode-py/actions/workflows/cd.yml)

[![codecov](https://codecov.io/gh/wislertt/leetcode-py/graph/badge.svg)](https://codecov.io/gh/wislertt/leetcode-py)

[![pypi](https://img.shields.io/pypi/v/leetcode-py-sdk.svg?color=blue)](https://pypi.org/project/leetcode-py-sdk/)

[![python versions](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue?logo=python)](https://github.com/wislertt/leetcode-py/)

## Why leetcode-py?

* **Tests come with the problem**: every generated problem ships a
  parametrized pytest suite with 10+ cases. You never write test scaffolding;
  you only make red go green.
* **Data structures you can see**: `TreeNode`, `ListNode`, and `GraphNode`
  convert between LeetCode's array format and live objects, and render as
  diagrams in Jupyter or clean ASCII in the terminal.
* **1405 problems ready
  to generate**: Grind 75, Blind 75, NeetCode 150,
  NeetCode 250, and Algo Master 75 as reproducible JSON templates.

See the full pitch in [Why leetcode-py](https://leetcode-py.wisl.dev/getting-started/why-leetcode-py.md).

![lcpy gen, pytest red to green, and an ASCII tree in the terminal](https://mintcdn.com/leetcode-py/zKzzNffnwxqOwDEE/img/preview/lcpy-preview.gif?s=5d3f78fa843516aae5e95a1ab84c350d)

## A taste

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
lcpy gen -n 1   # generate Two Sum: README, solution stub, 10+ parametrized tests
cd leetcode/two_sum
python -m pytest test_solution.py   # red -> implement solution.py -> green
```

> [card] [Installation](https://leetcode-py.wisl.dev/getting-started/installation.md)
>
> Install the CLI from PyPI, or clone the repo for development.

> [card] [Quickstart](https://leetcode-py.wisl.dev/getting-started/quickstart.md)
>
> Generate your first problem, run its tests, and solve it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.