maximumSum=0 is incorrect initialization(may be)

suppose an array with all negative integers, then our assumption gives error. Instead we may use
maximumSum=a[0];

@mayankA47 hey Mayank are you talking about kadane’s algorithm?

yes you are right Mayank also we can use maximumSum = INT_MIN also.

@mayankA47 I hope I’ve cleared your doubt. Please mark this doubt as resolved and rate me on the basis of your experience. Rating option is just below where you mark this doubt as resolve. Your feedback is very important. It helps us to 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.