Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Max Consecutive Ones III
Bookmark
Input
Example 1
Example 2
All ones
All zeros
Custom
nums
=
[1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0]
,
k
=
2
0
1
2
3
4
5
6
7
8
9
10
1
1
1
0
0
0
1
1
1
1
0
zeros used =
0
k =
2
algo
master
.
io
Step:
Start of algorithm
0 / 42
Input
Example 1
Example 2
All ones
All zeros
Custom
nums
=
[1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0]
,
k
=
2
0 / 42
0
1
2
3
4
5
6
7
8
9
10
1
1
1
0
0
0
1
1
1
1
0
zeros used =
0
k =
2
algo
master
.
io
Step:
Start of algorithm