Calendar max bookings

Write codeHard30 minGoogle style

Your task

Implement MyCalendarThree as a single function: given a chronological list of [start, end) booking requests, every request is accepted (overlaps allowed). After each booking, the 'k-booking' is the maximum number of bookings that overlap at any single point. Return a list whose i-th element is the maximum k-booking after the first i+1 bookings have been added. Times are in [0, 10^9) and there are up to 400 bookings.

Examples

calendar_three(bookings: list[list[int]]) -> list[int]
Example 1
Inputcalendar_three([[10, 20], [50, 60], [10, 40], [5, 15], [5, 10], [25, 55]])
Output[1, 1, 2, 3, 3, 3]