3065. Minimum Operations to Exceed Threshold Value I
Easy
You are given a 0-indexed integer array nums
, and an integer k
.
In one operation, you can remove one occurrence of the smallest element of nums
.
Return the minimum number of operations needed so that all elements of the array are greater than or equal to k
.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= nums.length <= 50
1 <= nums[i] <= 109
1 <= k <= 109
The input is generated such that there is at least one index
i
such thatnums[i] >= k
.
Last updated