FinMechanics Interview Question

A tweak on Kadanes Algorithm