> ## 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.

# lcpy Errors and Troubleshooting

> Fixes for the lcpy errors users hit most, each on its own page, plus contributor fixes for bake tasks and generated-file drift.

Every user-facing error gets its own page with the exact message, the
cause, and the fix:

* [lcpy gen Error: Problem Not Found](https://leetcode-py.wisl.dev/troubleshooting/unknown-problem.md)
* [lcpy gen Error: Problem Already Exists](https://leetcode-py.wisl.dev/troubleshooting/files-already-exist.md)
* [Visualizations Show ASCII Instead of Diagrams](https://leetcode-py.wisl.dev/troubleshooting/graphviz-missing.md)
* [Playground Notebook Cells Do Not Render](https://leetcode-py.wisl.dev/troubleshooting/notebook-cells.md)

The rest of this page covers contributor-side failures in the repository
itself.

## check-consistency reports drift

`leetcode/` is generated from JSON templates; editing a generated file by
hand always resurfaces as drift. Fix it at the source:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# edit src/leetcode_py/cli/resources/leetcode/json/problems/<name>.json
bake p-gen -p <name> --force
bake check-consistency
```

If you already solved the problem, copy your `solution.py` out first,
regenerate, then copy it back. The generated tree must match the templates
exactly.

## bake brand fails on svg conversion

Brand asset regeneration converts SVG to PNG through `rsvg-convert`, which
comes from librsvg: `brew install librsvg`. Details live in
`scripts/branding/BRAND.md`.

## bake docs issues

* **`mintlify: command not found`**: the CLI comes from mise; run `mise
  install` in the repo, or use `mise exec npm:mintlify -- mintlify dev`.
* **`must be run in a directory where a docs.json file exists`**: run from
  `docs/`, or use `bake docs` which does that for you.
* **Port already in use**: the dev server listens on port 3000; stop the
  other process or pass `--port`.

## Still stuck

Open an issue on
[GitHub](https://github.com/wislertt/leetcode-py/issues) with the command
you ran and its output.


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