Variable Size Sliding Window Algorithm Javascript Playground