Maximum Circular Sum 1


wrong answer? in test case

Hi!
There can be 2 cases in this question:
When max sum is given without wrapping:
Example: 1,-2,10,11,-1,20,-50
here 10,11,-1,20 will give the max sum, simple case : here kadane’s algo will work fine

case 2: Wrapping:
Example: -1 100 -10 17 3 4 -2 -2
here max sum will be given by 17,3,4,-2,-2,-1,100
wrapping is there, as we are starting at 17 then going on till -2,-2 and then going at -1,100 (as its a circular array so we can start from any point), here simple Kadane’s algo won’t work.
Take hint from this:

Again wrong answer for thiscode

can anyone reply the doubt ?

Hey Ajit, sorry for the late reply. Let me check

You have to first take t as input, see the input format