Amazon Interview Question

Question was mix of sliding window technique and using dequeue.