#3229

Minimum Operations to Make Array Equal to Target

master · 1670 · lc hard +32 · 41.4% accepted · 293 likes · top 22%

Description

You are given two equal-length positive integer arrays nums and target. Each operation selects any subarray and increments or decrements all elements in it by 1.

Return the minimum number of operations to transform nums into target.

Code

1
2
3