Problem 922 · Easy

Sort Array By Parity II

Rearrange a list so that even values sit at even indices and odd values sit at odd indices. The visual moves two markers along the index slots in steps of two.

Open the interactive visualisation