Leetcode Subarray With Given Sum With Javascript