Subarrays With Distinct Integers Leetcode Javascript