Back to Questions

Sliding Window Maximum

58K viewsAsked at Google
Hard

Question Explain

Given an array `nums` and a sliding window size $k$, find the maximum number in each window. Use a Deque (Double-Ended Queue) for an $O(n)$ solution.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question