sir iam not able to understand the pdf of this question what is the logic behind inverting the array and clculating candidate 2 in that pdf
Maximum Circular Subarray Sum
The following problem will have 2 test cases :
Case 1: The elements that contribute to the maximum sum are arranged such that no wrapping is there. In this case, Kadane’s algorithm will produce the result.
Case 2: The elements which contribute to the maximum sum are arranged such that wrapping is there. In this case, we change wrapping to non-wrapping. Wrapping of contributing elements implies non wrapping of non contributing elements, so find out the sum of non contributing elements and subtract this sum from the total sum. To find out the sum of non contributing, invert sign of each element and then run Kadane’s algorithm.
Our array is like a ring and we have to eliminate the maximum continuous negative that implies maximum continuous positive in the inverted arrays.
Finally we compare the sum obtained by both cases, and return the maximum of the two sums.
Can u tell wht are u not able to understand now…I have explained you the concept already