Search
⌘K

Leetcode 1300. Sum of Mutated Array Closest to Target

Find an integer cap such that replacing every element greater than the cap with the cap makes the array's sum as close as possible to the target (tie-breaker: choose the smaller cap). The mutated sum is monotonic in the cap, enabling a search over possible cap values.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.