3066. Minimum Operations to Exceed Threshold Value II
You are given a 0-indexed integer array
nums, and an integerk.In one operation, you will:
- Take the two smallest integers
xandyinnums.- Remove
xandyfromnums.- Add
min(x, y) * 2 + max(x, y)anywhere in the array.Note that you can only apply the described operation if
numscontains at least two elements.Return the minimum number of operations needed so that all elements of the array are greater than or equal to
k.