calendar
.book(start, end)
call:
a. Perform a binary search to find the index idx
where start
would be inserted.
b. Check for a conflict with the event at idx-1
(if it exists).
c. Check for a conflict with the event at idx
(if it exists).
d. If there are no conflicts, insert the event at idx
and return true
.
e. If there is a conflict, return false
.