Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Time Needed to Buy Tickets
Bookmark
Input
Standard
Example 2
Larger
Custom
tickets
=
[2, 3, 2]
,
k
=
2
k
2
3
2
k's rounds = 2
0
1
2
each person buys min(their tickets, k's rounds) before k is done
time =
0
algo
master
.
io
Step:
Start: how long until person 2 finishes buying all 2 of their ticket(s)?
0 / 10
Input
Standard
Example 2
Larger
Custom
tickets
=
[2, 3, 2]
,
k
=
2
0 / 10
k
2
3
2
k's rounds = 2
0
1
2
each person buys min(their tickets, k's rounds) before k is done
time =
0
algo
master
.
io
Step:
Start: how long until person 2 finishes buying all 2 of their ticket(s)?