Problem 3776 · Medium

Minimum Moves to Balance Circular Array

Fill the single deficit from the nearest surplus people around the circle, paying one move per unit of distance.

Open the interactive visualisation