Amazon Interview Question

Deque question, asked to find the second maximum in sliding window