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.Paste any Python algorithm in the left panel, or pick a ready-made example from the Algorithm dropdown in the header.
Type your test case in the TEST INPUT box at the bottom-left. LeetCode format works directly, just paste it in.
nums = [2,7,11,15], target = 9. Your input auto-saves every time.
Click RUN (or press ⌘/Ctrl + Enter). Your code executes line-by-line inside your browser. No server, no install.
Use the ← → arrows (or keyboard arrow keys) to move one step at a time. Watch exactly which variable changes at each line.
Arrays, linked lists, binary trees, heaps, grids, graphs: all rendered as visual shapes. Recursion auto-builds a call-tree.
After running, click the O(n) button in the bottom bar. Every line gets a complexity badge with a plain-English reason why.
Give this snippet a memorable name. It will be saved in your browser only.
Tip: existing snippet with the same name will be overwritten.
Paste any DSA problem statement — LeetCode, an interview question, anything. Runs entirely in your browser (no API key, no network call) and walks the same thought process every time: restate it, find the brute force, spot the waste, read the constraints, name the pattern, and check the traps.
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.