For which of the following inputs would Kadane's algorithm produce a WRONG output?
{1,0,-1}
{-1,-2,-3}
{1,2,3}
{0,0,0}
Correct Answer: B — {-1,-2,-3}
Explanation:
Kadane's algorithm doesn't work for all negative numbers. So, the answer is {-1,-2,-3}.