Two Subarrays Leetcode Javascript Interview