Maximum Subarray Leetcode Solution Python