We’re preparing your current view and syncing the latest data.
You need to implement a MyCalendarTwo class to store your events. A new event can be added if it does not cause any triple booking (no time slot is booked for three different events). Double bookings are allowed. Implement the methods to add events and check if the booking is possible without triple booking.
A sequence of calls to the book method with a pair of integers [start, end) representing the event to book.
Return true if the event can be booked without causing a triple booking; otherwise, return false.
The start and end values are integers where 0 <= start < end <= 10^9. The number of calls to book can be up to 10^4.