Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Summary Ranges
Bookmark
Input
Standard
Multiple ranges
All consecutive
All single
Single element
Custom
nums
=
[0, 1, 2, 4, 5, 7]
0
1
2
3
4
5
0
1
2
4
5
7
result
[ ]
0
1
2
3
4
5
0
1
2
4
5
7
result
[ ]
0
1
2
3
4
5
0
1
2
4
5
7
i
start
result
"0"
0
1
2
3
4
5
0
1
2
4
5
7
i
start
result
"0->1"
0
1
2
3
4
5
0
1
2
4
5
7
i
start
result
"0->2"
0
1
2
3
4
5
0
1
2
4
5
7
i
result
"0->2"
0
1
2
3
4
5
0
1
2
4
5
7
i
start
result
"0->2"
"4"
0
1
2
3
4
5
0
1
2
4
5
7
i
start
result
"0->2"
"4->5"
0
1
2
3
4
5
0
1
2
4
5
7
i
start
result
"0->2"
"4->5"
"7"
0
1
2
3
4
5
0
1
2
4
5
7
i
start
result
"0->2"
"4->5"
"7"
0
1
2
3
4
5
0
1
2
4
5
7
result
"0->2"
"4->5"
"7"
algo
master
.
io
Step:
Start: merge runs of consecutive numbers into ranges
0 / 20
Input
Standard
Multiple ranges
All consecutive
All single
Single element
Custom
nums
=
[0, 1, 2, 4, 5, 7]
0 / 20
algo
master
.
io
Step:
Start: merge runs of consecutive numbers into ranges