← 返回 microsoft 的题目列表My Calendar I
类型:online_judge
Implement a calendar system where you can add a new event if the event will not cause a double booking.
Input Implement the MyCalendar class:
MyCalendar() Initializes the calendar object.
bool book(int start, int end) Attempts to add the event [start, end) to the calendar. An event represents the time range [start, end), and is a half-open interval.
Return true if the event can be added to the calendar successfully without causing a double booking. Otherwise, return false and do not add it.
Example
Input:
`[
Example
Input
{"command": "book", "start": 10, "end": 20}