Amazon Interview Question

The sliding window problem from leetcode.