Problem 462 · Medium

Minimum Moves to Equal Array Elements II

Find the fewest unit changes that make every array value equal, where each move changes one value by one. The visual lays the values on a number line and pulls them toward a middle point while summing the distances.

Open the interactive visualisation