Optum Interview Question

An extended version of Kadane's algorithm.