3914. Minimum Operations to Make Array Non Decreasing
You are given an integer array
numsof lengthn.In one operation, you may choose any subarray
nums[l..r]and increase each element in that subarray byx, wherexis any positive integer.Return the minimum possible sum of the values of
xacross all operations required to make the array non-decreasing.An array is non-decreasing if
nums[i] <= nums[i + 1]for all0 <= i < n - 1.
1 | class Solution { |