Leetcode Subarray Products Hackerrank Javascript Solutions