Given an array A of N (N<=10^6) elements , you can choose any subarray and invert the sign of all elements lying in that subarray i.e positive elements are changed to negative and vice versa.

You have to apply this operation exactly once. Determine the minimum possible sum of absolute difference of adjacent array elements that can be obtained after applying the operation exactly once. -10^9<=A[i]<=10^9.

Link to problem: Problem - I - Codeforces

Please suggest how to approach this problem.