Sliding Window Maximum
Last updated
What is Sliding Window Maximum?
Given an array and a window size k, return the maximum value in each window. A monotonic deque stores indices in decreasing order of value, so the front is always the current maximum. This problem teaches you the monotonic deque, which gives O(n) window max where a heap would give O(n log n).
Free resources to learn Sliding Window Maximum
More in stage 8: Sliding Window
Sliding Window Maximum: common questions
Can I learn Sliding Window Maximum in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Sliding Window Maximum in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Sliding Window Maximum tutorial for beginners?
It is lesson 45 of 137 in the free LeetCode roadmap, in stage 8, Sliding Window. If you are new to LeetCode, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.