Search
⌘K

Leetcode 3091. Apply Operations to Make Sum of Array Greater Than or Equal to k

Starting from nums = [1], find the minimum number of operations (increment any element by 1 or duplicate any element) needed to make the array sum ≥ k; the core challenge is balancing how many times to duplicate versus how much to increment a base element (choose m duplicates and value v with v*(m+1) ≥ k to minimize (v−1)+m).


Question Timeline

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

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