Amazon interview question

Maxium Subarray Problem