Leetcode Subarray Products Hackerrank Javascript Intermediate