Learn
Practice
Newsletter
Resources
Mobile
New
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Longest Consecutive Sequence
Bookmark
Input
Example 1
Example 2
Example 3
Custom
nums
=
[100, 4, 200, 1, 3, 2]
nums
100
4
200
1
3
2
nums
100
4
200
1
3
2
nums
100
4
200
1
3
2
set (sorted)
⁄⁄
⁄⁄
start
4
start
100
start
200
nums
100
4
200
1
3
2
set (sorted)
⁄⁄
⁄⁄
start
1
2
3
4
start
100
start
200
nums
100
4
200
1
3
2
current
1
longest
0
set (sorted)
⁄⁄
⁄⁄
start
1
2
3
4
start
100
start
200
length 1
nums
100
4
200
1
3
2
current
4
longest
0
set (sorted)
⁄⁄
⁄⁄
start
1
2
3
4
start
100
start
200
length 4
nums
100
4
200
1
3
2
current
0
longest
4
set (sorted)
⁄⁄
⁄⁄
start
1
2
3
4
start
100
start
200
skip: 1 exists
nums
100
4
200
1
3
2
current
0
longest
4
set (sorted)
⁄⁄
⁄⁄
start
1
2
3
4
start
100
start
200
skip: 3 exists
nums
100
4
200
1
3
2
current
1
longest
4
set (sorted)
⁄⁄
⁄⁄
start
1
2
3
4
start
100
start
200
length 1
nums
100
4
200
1
3
2
current
1
longest
4
set (sorted)
⁄⁄
⁄⁄
start
1
2
3
4
start
100
start
200
length 1
nums
100
4
200
1
3
2
current
0
longest
4
set (sorted)
⁄⁄
⁄⁄
start
1
2
3
4
start
100
start
200
longest consecutive = 4
algo
master
.
io
Step:
Find the longest run of consecutive integers
0 / 35
Input
Example 1
Example 2
Example 3
Custom
nums
=
[100, 4, 200, 1, 3, 2]
0 / 35
algo
master
.
io
Step:
Find the longest run of consecutive integers