Variable Size Sliding Window Algorithm Leetcode Rating System