This Kadane's algo problem took me some time to solve