Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
My Calendar II
Bookmark
Two Lists
Line Sweep
Input
Example
Triple Booking
All Pass
Custom
operations
=
[MyCalendarTwo, book, book, book, book, book]
,
values
=
[null, 10,20, 50,60, 10,40, 5,15, 5,10]
MyCalendarTwo
attempt
bookings
empty
double
none
0
10
20
30
40
50
60
0 bookings, 0 double booked
Booked
Attempt
Comparing
Double booked
Triple
MyCalendarTwo
attempt
bookings
empty
double
none
0
10
20
30
40
50
60
0 bookings, 0 double booked
Booked
Attempt
Comparing
Double booked
Triple
book(50, 60)
attempt
50-60
bookings
10-20
double
none
0
10
20
30
40
50
60
1 bookings, 0 double booked
Booked
Attempt
Comparing
Double booked
Triple
book(50, 60)
attempt
bookings
10-20
50-60
double
none
0
10
20
30
40
50
60
2 bookings, 0 double booked
Booked
Attempt
Comparing
Double booked
Triple
book(10, 40)
attempt
10-40
bookings
10-20
50-60
double
none
0
10
20
30
40
50
60
2 bookings, 0 double booked
Booked
Attempt
Comparing
Double booked
Triple
book(10, 40)
attempt
10-40
bookings
10-20
50-60
double
10-20
0
10
20
30
40
50
60
2 bookings, 1 double booked
Booked
Attempt
Comparing
Double booked
Triple
book(5, 15)
attempt
5-15
bookings
10-20
50-60
10-40
double
10-20
0
10
20
30
40
50
60
3 bookings, 1 double booked
Booked
Attempt
Comparing
Double booked
Triple
book(5, 10)
attempt
5-10
bookings
10-20
50-60
10-40
double
10-20
0
10
20
30
40
50
60
3 bookings, 1 double booked
Booked
Attempt
Comparing
Double booked
Triple
book(5, 10)
attempt
5-10
bookings
10-20
50-60
10-40
double
10-20
0
10
20
30
40
50
60
3 bookings, 1 double booked
Booked
Attempt
Comparing
Double booked
Triple
book(5, 10)
attempt
5-10
bookings
10-20
50-60
10-40
double
10-20
0
10
20
30
40
50
60
3 bookings, 1 double booked
Booked
Attempt
Comparing
Double booked
Triple
MyCalendarTwo
attempt
bookings
10-20
50-60
10-40
5-10
double
10-20
0
10
20
30
40
50
60
4 bookings, 1 double booked
Booked
Attempt
Comparing
Double booked
Triple
algo
master
.
io
Step:
Start with an empty booking list and no double-booked regions
0 / 38
Input
Example
Triple Booking
All Pass
Custom
operations
=
[MyCalendarTwo, book, book, book, book, book]
,
values
=
[null, 10,20, 50,60, 10,40, 5,15, 5,10]
0 / 38
algo
master
.
io
Step:
Start with an empty booking list and no double-booked regions