Maximum Subarray Min Product Leetcode Javascript