3824. Minimum K to Reduce Array Within Limit
You are given a positive integer array
nums.For a positive integer
k, definenonPositive(nums, k)as the minimum number of operations needed to make every element ofnumsnon-positive. In one operation, you can choose an indexiand reducenums[i]byk.Return an integer denoting the minimum value of
ksuch thatnonPositive(nums, k) <= k^2.
1 | class Solution { |