Kadane's solution to the Maximum Subarray problem