My Calendar I
CodingOnsiteSoftware EngineerReported Nov, 2025
Examples
Example 1:
Input: ["MyCalendar","book","book","book"]
[[],[10,20],[15,25],[20,30]]
Output: [null,true,false,true]
Example 1:
Input: ["MyCalendar","book","book","book"]
[[],[10,20],[15,25],[20,30]]
Output: [null,true,false,true]
Implement a calendar that stores booked half-open intervals [start, end).
A booking is valid only if it does not overlap with any existing booking. Return true when the event can be added and false otherwise.
0 <= start < end <= 10^91000 calls will be made to book.Reported as LeetCode 729 in a software engineer onsite round.