Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Bookmark
Input
Standard
Example 2
Limit = 0
Custom
nums
=
[8, 2, 4, 7]
,
limit
=
4
8
0
2
1
4
2
7
3
MaxDeque (decreasing)
MinDeque (increasing)
maxLen: 0
spread: -
limit: 4
algo
master
.
io
Step:
Start: find longest subarray with |max - min| <= 4
0 / 28
Input
Standard
Example 2
Limit = 0
Custom
nums
=
[8, 2, 4, 7]
,
limit
=
4
0 / 28
8
0
2
1
4
2
7
3
MaxDeque (decreasing)
MinDeque (increasing)
maxLen: 0
spread: -
limit: 4
algo
master
.
io
Step:
Start: find longest subarray with |max - min| <= 4