MathWorks Interview Question

Kadane's algorithm