Watch algorithms run, line by line.
Pick a classic problem, choose a test case and press play. The reference solution steps through in 3D while the line it's executing lights up.
8 problems · 24 test cases · free, no sign-up
Compare nums[4] = 16 with 23
function binarySearch(nums: number[], target: number): number {
let lo = 0;
let hi = nums.length - 1;
while (lo <= hi) {
const mid = Math.floor((lo + hi) / 2);
if (nums[mid] === target) {
return mid;
}
if (nums[mid] < target) {
lo = mid + 1;
} else {
hi = mid - 1;
}
}
return -1;
}From statement to solution in four steps.
1. Read the problem
A plain-language statement with worked examples.
2. Pick a test case
Each problem ships several, from tiny inputs to tricky edge cases.
3. Press play
Space plays or pauses; the arrow keys step; Home and End jump.
4. Follow the line
The running line is highlighted, and recursive calls stack up beside it.
Every line, lit as it runs.
The code sits next to the scene, and the line being executed is highlighted at every step, with a plain-English note on what just happened.
- Step forward and back at your own pace
- Narration written into each solution
- Syntax highlighting in light and dark
Recursion, frame by frame.
Recursive solutions show their call stack as it grows and unwinds, so you always know which call you're in and where it will return.
- The current frame is highlighted
- Arguments shown for every call
- Caller lines stay marked in the code
Arrays, grids, trees and graphs.
Each data structure gets its own 3D view: bars for arrays, tiles for DP tables, and laid-out nodes for trees and graphs.
- Pointers and comparisons drawn in place
- Orbit, zoom and pan the scene
- Works with touch on phones and tablets
Arrays
Grids and DP tables
Trees
Graphs
Recorded, not simulated.
Every step you see was recorded by running the real TypeScript solution when the site was built. Your browser only plays the trace back: fast, deterministic and gentle on your battery.
- problems
- 8
- traced test cases
- 24
- structure kinds
- 5
- sign-ups
- 0
Choose a problem.
Sorted from easy to hard.
Binary Search
easyYou are given a list of integers nums arranged in strictly increasing order, and a single integer target.
arrays · binary search3 testsBinary Tree Max Depth
easyYou are given a binary tree. Its depth is the number of nodes on the longest path that starts at the root and walks down to a node with no children.
trees · recursion3 testsBubble Sort
easyGiven a list of integers nums, return a new list with the same values arranged from smallest to largest.
arrays · sorting3 testsTwo sum sorted
easyTODO: describe the task in your own words. Name the inputs with code formatting.
arrays3 testsBFS Shortest Hops
mediumYou are given an undirected graph and a starting node, source. Moving along one edge counts as one hop.
graphs · breadth-first search3 testsLongest Common Subsequence
mediumYou are given two strings, a and b. A subsequence keeps some of a string's characters, in their original order, and drops the rest. For example, "ACE" is a subsequence of "ABCDE".
strings · dynamic programming3 testsPair Sum in a Sorted Array
mediumYou have a list of integers nums sorted from smallest to largest, and an integer target.
arrays · two pointers3 testsPermutations
mediumGiven a list of distinct integers nums, return every possible ordering of its values.
recursion · backtracking3 tests
Frequently asked questions
Is it free?
Yes. There's no account, no sign-up and nothing to install.
What language are the solutions in?
TypeScript. Each one is a short, readable reference solution, the kind you'd write in an interview.
Can I run my own code?
No. Every step was recorded from the reference solution when the site was built; the browser plays that recording back and never executes solution code.
Does it work on my phone?
Yes. The layout adapts to phones and tablets, and the 3D view supports drag and pinch.
What are the keyboard shortcuts?
Space plays and pauses, ← and → step back and forward, and Home and End jump to the first or last step.
Pick a problem. Press play.
Start with Binary Search, or browse the full list.