What if all are -ve numbers like -4,-3,-2

here -2 is greater but it will print 0 according to solution in video

Kadane’s algo doesnt work when all array elements are negative, so atleast one element needs to be positive for it to work…

Since you arent replying anything, I am marking this doubt as resolved, You can reopen it if you face any issues…