← ALL NOTES
Array

453. Minimum Moves to Equal Array Elements

Adding 1 to n-1 elements and subtracting 1 from the remaining one are the same operation as far as this question can tell. Equality is a claim about differences, and both versions shift every pairwise difference by exactly the same amount; the only thing they disagree on is the final common value, w

Loading…