Maximum Good Subarray Sum Leetcode Javascript 30