Array
3736. Minimum Moves to Equal Array Elements III
Increments only, which means the finish line is fixed before you make a single move. No element can ever come down, so the common value has to be at least the largest one already in the array; and every unit you climb above that largest value costs one extra move per element, all n of them. The target is max, and the answer is the sum of the gaps to it.
Loading…