Problem 2938 · Medium

Separate Black and White Balls

Each white ball must pass every black ball to its left; count those passes in one scan.

Open the interactive visualisation