Problem 2938 · Medium
Each white ball must pass every black ball to its left; count those passes in one scan.
Open the interactive visualisation