Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Longest Consecutive Sequence
Bookmark
Brute Force
Sorting
Hash Set
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
start
current
1
longest
1
nums
100
4
200
1
3
2
start
current
1
longest
1
nums
100
4
200
1
3
2
start
current
1
longest
1
scanning for 3
100
4
200
1
3
2
start
current
3
longest
1
5? not in array
100
4
200
1
3
2
start
current
4
longest
1
scanning for 4
100
4
200
1
3
2
start
current
2
longest
4
nums
100
4
200
1
3
2
start
current
1
longest
4
5? not in array
100
4
200
1
3
2
start
current
3
longest
4
nums
100
4
200
1
3
2
current
0
longest
4
longest consecutive = 4
algo
master
.
io
Step:
Find the longest run of consecutive integers
0 / 26
Input
Example 1
Example 2
Example 3
Custom
nums
=
[100, 4, 200, 1, 3, 2]
0 / 26
algo
master
.
io
Step:
Find the longest run of consecutive integers