Variable Size Sliding Window Leetcode Question