Sliding Window Algorithm Leetcode Two