Given an initial integer array arr, repeatedly modify the elements simultaneously based on the following rules:
An element is incremented by
An element is decremented by
The first and last elements of the array never change.
This modification process is applied repeatedly until the array stops changing. Return the final modified array.
Constraints:
arr.length
arr[i]
Given an initial integer array arr, repeatedly modify the elements simultaneously based on the following rules:
An element is incremented by
An element is decremented by
The first and last elements of the array never change.
This modification process is applied repeatedly until the array stops changing. Return the final modified array.
Constraints:
arr.length
arr[i]