Trace runs Python code line-by-line in your browser (via Pyodide / WebAssembly) and visualizes every variable mutation — heaps as trees, linked lists as chains, grids as cells, sets/dicts/queues as native shapes. Perfect for understanding LeetCode solutions, teaching algorithms, or debugging tricky logic.
nums = [1,2,3], target = 9 — standard LeetCode formathead = [1,2,3], pos = 1 — auto-builds linked lists (with cycles)root = [3,9,20,null,null,15,7] — auto-builds binary trees["MedianFinder", "addNum", ...] / [[], [1], ...] — Design problems (auto-detected)Input: prefix handled automaticallyYour code and test input are saved to your browser's local storage automatically as you type. Reload the page anytime — your work is preserved. Use Save Snippet to keep a named copy of any solution you want to revisit.
Click Share to generate a URL that encodes your code + input. Anyone with the link can open the same scenario in their browser — no account required.
self.x) are auto-captured and shown.Give this snippet a memorable name. It will be saved in your browser only.
Tip: existing snippet with the same name will be overwritten.
Something not working, or a wrong visualization? Tell us what happened — your current code & test input are attached automatically so we can reproduce it.
We attach: your code, test input, current step, theme, and browser info. No personal data.