Loading
Loading
Move every zero to the end of an array without allocating a second one. A read pointer visits each slot while a write pointer trails behind marking where the next kept value belongs; the gap between them is the number of values discarded so far.
Use ← → to step, Space to play or pause, and the Input button to run it on your own data.