Cses Problem Set Maximum Subarray Algorithm