#K68672. Maximum Rooms Occupied

    ID: 32917 Type: Default 1000ms 256MiB

Maximum Rooms Occupied

Maximum Rooms Occupied

Given a list of hotel bookings, each represented by a check-in date and a check-out date (formatted as \(YYYY-MM-DD\)), your task is to determine the maximum number of rooms occupied at any moment.

Note that if a booking ends on the same day another begins, they are not considered overlapping because the check-out is processed before the check-in.

inputFormat

The input is given via standard input (stdin). The first line contains an integer (n) representing the number of bookings. Each of the following (n) lines contains two strings separated by a space: the check-in date and the check-out date, respectively.

outputFormat

Output to standard output (stdout) a single integer representing the maximum number of rooms that are occupied concurrently.## sample

1
2023-01-01 2023-01-05
1