Available question text
Given n and the array arr[i]=2*i+1, compute the minimum number of unit transfers (subtract 1 from one element and add 1 to another) required to make all elements equal — equivalently the sum of absolute deviations to the median divided by 2. This has a closed form: answer = floor(n/2) * ceil(n/2) (i.e., n^2/4 for even n and (n^2-1)/4 for odd n).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1551. Minimum Operations to Make Array Equal
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source