operations
to target[0]
since we need at least that many operations to reach the first element.target
array starting from the second element.operations
by the difference between the current element and the previous element.operations
as the minimum number of operations needed.