maximum circular sum
https://ide.codingblocks.com/s/51607
what is wrong with the code ??
Maximum circular array
Hey Agraj, it is given in the problem the first line of input contains integer t which is number of test case, you haven’t taken the input for that.
https://ide.codingblocks.com/s/51607
still it is wrong, can you tell me what is wrong with the logic?
Hey, your approach is not correct, analyze your code, for this given input
1
7
8 -8 9 -9 10 -11 12
your code will consider the max sum as (10 -11 + 12) = 11
but it will never consider the case (12 + 8 - 8 + 9 - 9 + 10) = 22
for the test case a[n-1]=12
12 will be taken from the first inner loop
and rest ele,ents will be taken from second loop???
first 12, then 8 -8 9 -9 10, then -11,but sum will be less than max, so max remains till 10
https://ide.codingblocks.com/s/51607