Maximum Circular Sum

Test case 1 is not passing . Why?

Your code will not work in this case

5
-5 3 4 -2 1

Your output
6
Correct Output
7

You have to consider both cases

  1. circular sum wala (which you have consider)
  2. simple max sum Algorithm (kadane’s algo)

Modified Code

i hope it helps

got it, thank you…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.