Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Sliding Window Maximum
Bookmark
Input
Example 1
Single Element
k = 1
Example 2
Custom
nums
=
[1, 3, -1, -3, 5, 3, 6, 7]
,
k
=
3
nums
0
1
1
3
2
-1
3
-3
4
5
5
3
6
6
7
7
deque
result
algo
master
.
io
Step:
Start of algorithm
Variable
Value
nums
Array(8) [1, 3, -1...]
k
3
deque
[]
Variable
Value
result
[]
i
0
0 / 31
Input
Example 1
Single Element
k = 1
Example 2
Custom
nums
=
[1, 3, -1, -3, 5, 3, 6, 7]
,
k
=
3
0 / 31
nums
0
1
1
3
2
-1
3
-3
4
5
5
3
6
6
7
7
deque
result
algo
master
.
io
Step:
Start of algorithm
Visualization
Variables