Search
⌘K
Get Premium
Leetcode 2439. Minimize Maximum of Array
You can repeatedly move one unit from any element to its immediate left neighbor; find the smallest possible value of the array's maximum after any number of such leftward transfers. Key insight: because mass only moves left, the answer equals the maximum (rounded up) prefix average across all prefixes, so scan prefixes or binary-search with a greedy check.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.