Maxuimum circular subarray sum


what’s the error in my code as i am not getting correct output
.

@aditi2512201012019
hello aditi,
image
a) why 2?
b) sum2 should be total array sum -ms2

and my total sum of original array is ms1 only.

i corrected that 2 though.

@aditi2512201012019
aditi i think u are storing maximum subarray sum in ms1 ,pls check

should i consider cs1 instead of ms1?

@aditi2512201012019
no ,store array sum in separate variable and use it

i have stored sum in another array but still i am always getting same ans = 12 everytime https://ide.codingblocks.com/s/194861

@aditi2512201012019
aditi in line number 28 it should be sum1 - (-ms2) because ms2 is maximum sum after negating the array.so to get actual sum we need to add - sign.

in case u have any doubt in approach pls refer this
image