Implementing MyCalendar With Efficient Event Booking
Implement MyCalendar class with book method: store events as sorted list of intervals and check for overlaps before booking new events.
729. My Calendar I Difficulty: Medium Topics: Array, Binary Search, Design, Segment Tree, Ordered Set You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking. A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both events.). The event can be represented as a pair of integers start and end that represents a booking on the half-open interval [start, end), the range of real numbers x such that start <= x < end. Implement the MyCalendar class: MyCalendar() Initializes...
