Given an integer array nums, you can perform an operation where you choose an index i and either increment or decrement nums[i] by
Return the minimum number of operations required to make nums either non decreasing or non increasing.
Constraints:
nums.length
nums[i]
Given an integer array nums, you can perform an operation where you choose an index i and either increment or decrement nums[i] by
Return the minimum number of operations required to make nums either non decreasing or non increasing.
Constraints:
nums.length
nums[i]