Sliding Window Problem In Leetcode Sql