Implement a calendar that accepts a new event only when it does not cause a double booking. An event is a half-open interval [startTime, endTime), so an event ending at 20 and another starting at 20 do not overlap. MyCalendar() creates an empty calendar, and book(startTime, endTime) adds the event and returns true if it overlaps no existing event; otherwise it returns false and leaves the calendar unchanged.
Implement a calendar that accepts a new event only when it does not cause a double booking. An event is a half-open interval [startTime, endTime), so an event ending at 20 and another starting at 20 do not overlap. MyCalendar() creates an empty calendar, and book(startTime, endTime) adds the event and returns true if it overlaps no existing event; otherwise it returns false and leaves the calendar unchanged.