Problem 1089 · Easy

Duplicate Zeros

Duplicate each zero in a fixed-length array and shift the rest to the right, discarding anything that overflows. The writes are shown from the end of the array backward.

Open the interactive visualisation