Scala
Scala copied to clipboard
You are given an array of N integers. Return maximum value for all 1 …
…≤ i, j ≤ N, which is defined as |array[i] - array[j]| + |i - j|, where |x| denotes absolute value of x.