Maximum Subarray Leetcode Javascript Interview