Variable Size Sliding Window Algorithm Leetcode 1508