Code - https://ide.codingblocks.com/s/38977
Quest - https://hack.codingblocks.com/contests/c/512/1288
My output is correct in CB Ide for various test cases, but it’s showing the wrong answer while submitting.
Maximum Circular Sum Wrong Aswer
Hey, Mukul your code is not handling some of the possible corner cases. One more thing is your approach for this problem is not efficient as there is no need to make the array of 2*n.
Hint is try to solve the this problem by using Kadane’s algo and taking the array of size n only.
Can u tell which corner cases my code is not handling, actually my code is also using o(n) time so i find this a easy approach and want to proceed with it further.
check for this input test case
1
5
1 2 3 4 5
your code’s output is 25
but correct output is 15