Algo++ kadanes algorithm

what will happen if the value of current sum is equal of its negative values?

for example if we give input 1.-2,3,-4,5,-6,7
then 1 and 3 will be 4 . soit will be added to 4 or not as it becomes zero?

@itsexp_2302 hey anubhav in this case maximum sum is 7
1+(-2) =-1 so current sum is 0
0+3=3
3+(-4) =-1 so current sum is 0
0+5 =5
5+(-6)=-1 so current sum is 0
0+7 so current sum is 7 which is maximum sum in this case.

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.