Sliding Window Problem Programming