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.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.