You are given an integer array nums of length n.
In one operation, you can select a contiguous subarray of nums and a positive integer x, then increase each element in the selected subarray by x.
Return the minimum possible sum of all chosen values of x required to make nums non decreasing.
Constraints:
nums.length
nums[i]
You are given an integer array nums of length n.
In one operation, you can select a contiguous subarray of nums and a positive integer x, then increase each element in the selected subarray by x.
Return the minimum possible sum of all chosen values of x required to make nums non decreasing.
Constraints:
nums.length
nums[i]