Maximum Subarray Product Leetcode Problems Javascript