Subarray Question On Leetcode Javascript 30