Maximum Score From Subarray Minimums Leetcode Javascript Interview