Algorithm · Airbnb · Medium
There are n bookings, and each one occupies a half-open time interval $$[start, end)$$, where start is when the booking begins and end is when it finishes. Because the intervals are half-open, a booking that finishes at the very moment another one starts is not considered to overlap with it. Determine the largest number of bookings that are in progress simultaneously at any point in time. Input Format The first line holds an integer n, the number of bookings. Each of the…