please check the method. I have used kadane’s algorithm to find the minimum subarray sum and then subtract it from total sum of array.
Single Test Case left
see for this test case:
1
9
-3 -18 -22 -21 -17 16 -14 28 -22
your code is not producing the correct ouput
correct output should be: 30 which is from: 16 -14 28
The problem is for max circular sum. Is that test case answer is valid for this problem ?
yes ,why not ?In this problem, there can be two cases i.e. either the subarray having maximum sum is obtained in a circular fashion or the subarray having maximum sum is obtained in a non-
circular fashion.