3229. Minimum Operations to Make Array Equal to Target
You are given two positive integer arrays
nums
andtarget
, of the same length.In a single operation, you can select any subarray of
nums
and increment or decrement each element within that subarray by 1.Return the minimum number of operations required to make
nums
equal to the arraytarget
.
c++
1 |
|