Leetcode Window Function Javascript Mozilla