Variable Size Sliding Window Algorithm Javascript Interviewbit