Doesnt this algo fail if all the numbers are negative?
Negative Numbers in Kadane's Algorithm
Yes, thats true that Kadane’s algo will fail when all nos are negative, thus atleast one no should be positive atleast for it to work properly.
Doesnt this algo fail if all the numbers are negative?
Yes, thats true that Kadane’s algo will fail when all nos are negative, thus atleast one no should be positive atleast for it to work properly.