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

You are given a

positiveinteger`k`

. Initially, you have an array`nums = [1]`

.You can perform

anyof the following operations on the arrayanynumber of times (possibly zero):

- Choose any element in the array and
increaseits value by`1`

.- Duplicate any element in the array and add it to the end of the array.
Return

theminimumnumber of operations required to make thesumof elements of the final array greater than or equal to`k`

.

1 | class Solution { |