Can anyone elaborate how -

** f(i, j) = |A[i] - A[j]| + |i - j| can be written in 4 ways** (Since we are looking at max value, we don’t even care if the value becomes negative as long as we are also covering the max value in some way).

```
(A[i] + i) - (A[j] + j)
-(A[i] - i) + (A[j] - j)
(A[i] - i) - (A[j] - j)
(-A[i] - i) + (A[j] + j) = -(A[i] + i) + (A[j] + j)
```

Note that case 1 and 4 are equivalent and so are case 2 and 3.