Problem 2582 · Easy
Simulate the pillow bouncing between the ends of the line: reverse direction at person 1 and person n.
Open the interactive visualisation