playground.py, a scratchpad for poking
at inputs, inspecting data structures, and experimenting before you commit
to an approach. See Problem Anatomy for where
it fits.
Percent format, not .ipynb
Playgrounds are stored as jupytext percent format: plain Python with# %% cell markers.
.ipynb would add.
Open it as a notebook
Pick whichever fits your setup:- VS Code: the Python extension supports
# %%cells natively; openplayground.pyand run cells in the interactive window. - JupyterLab with the jupytext contents manager: same experience, in the browser.
- One-off conversion:
uv run jupytext --to ipynb leetcode/two_sum/playground.pygives you a realplayground.ipynb.

Convert back before committing
If you converted to.ipynb, convert back before you commit. The repo
keeps only the .py form: