Why my code is not passing the tst cases in the kadanes algo question of finding maximum subarray sum


thisnis my code

@kshitiz_joshi
Initialise csum and maxsum to 0 again for every new testcase.
Otherwise it just picks up old values and computes sum based on that giving wrong outputs.

1 Like