In this question, if we use the kadane’s algo then would it be right?
I guess I would not be right for array containing all negative numbers.
for eg:- array = {-5,-4,-3,-2,-1}
the maximum sum should be -1;
but by kadanes algo we would get 0;
In this question, if we use the kadane’s algo then would it be right?
I guess I would not be right for array containing all negative numbers.
for eg:- array = {-5,-4,-3,-2,-1}
the maximum sum should be -1;
but by kadanes algo we would get 0;