Maximum Good Subarray Sum Leetcode Solution Python