Leetcode Maximum Good Subarray Sums Hackerrank Solution