Skip to main content
From a clean install to a solved problem in five commands.

1. Generate a problem

This creates a leetcode/two_sum/ directory with a complete, testable scaffold. You can also generate a whole collection at once:
Browse every collection in the Catalog.

2. Look at what you got

Every problem has the same shape; see Problem Anatomy for what each file does.

3. Run the tests

The tests fail out of the box because solution.py is a TODO stub. That is the point: red, implement, green.

4. Solve it

Open solution.py and replace the TODO with your implementation:

5. Rerun the tests

All green? Move to the next problem. Stuck? Drop into playground.py and inspect your data structures: trees, linked lists, and graphs all render as diagrams. See Visualizations.

Working inside this repository

If you cloned the repo for development, the same loop goes through bake:
See the bakefile reference for everything else the runner provides.