Solving My Calendar I in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Your class will be called like this:

MyCalendar cal = new MyCalendar();, end)

Example 1:

MyCalendar();, 20); // returns true, 25); // returns false, 30); // returns true
The first event can be booked.  The second can't because time 15 is already booked by another event.
The third event can be booked, as the first event takes every time less than 20, but not including 20.


See the full details of the problem My Calendar I at LeetCode

Originally posted at: