/*
PROBLEM STATEMENT: Given an array of n integers, you need to find the maximum subarray sum, considering the fact that the array if circular.
In other words of if the array if arr[] then next value for the i-th index is i+1 if i |
2. Now the optimal subarray will be wrapper around the edges.
|- - - - - ]- - - - - - - [- - - - - - |
|left seg->| |<- right seg|
That is there will be two segments one from left another from right.
For the first case we will simply do Kadane. And store the result in val1,
For the second case if we look closely we will notice this relation
totalArray = leftSeg + MidLeftOutSeg + rightSeg
we need to find the leftSeg + rightSeg
or, leftSeg + rightSeg = totalArray - MidLeftOutSeg
So basically we need to minimize the absolute value of MidLeftOutSeg. Do we need to write another function for finding the minimum value of MidLeftOutSeg ? NO!! we will simply invert the values of the array and then again apply Kadane's Algo to get the max "inverted" sum, which is nothing but the minimum sum.
And then we will add( why add ? because we once inverted the signs and minus of minus makes plus. ) So we will val2.
Now finally we will return the max value of val1 and val2
*/