Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Contains Duplicate II
Bookmark
Input
Example 1
Example 2
Example 3
Custom
nums
=
[1, 2, 3, 1]
,
k
=
3
1
2
3
1
0
1
2
3
Hash Map (num → index)
k = 3
algo
master
.
io
Step:
Check if any duplicate exists within distance k = 3
0 / 15
Input
Example 1
Example 2
Example 3
Custom
nums
=
[1, 2, 3, 1]
,
k
=
3
0 / 15
1
2
3
1
0
1
2
3
Hash Map (num → index)
k = 3
algo
master
.
io
Step:
Check if any duplicate exists within distance k = 3