Dsa
Monotonic Stack
Easy
Max Sliding Window
Given an array of integers and a sliding window size, return the maximum value in each sliding window.
Input format:
- A single line containing space-separated integers, followed by an integer indicating the window size.
Output format:
- A single line containing space-separated integers representing the maximum values in each sliding window.
Example:
Input:
1 3 -1 -3 5 3 6 7 3
3
Output:
3 3 5 5 6 7
Key concepts
monotonic_stacksliding_windowmaximum
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now