Objective
To know how many meetings overlap at once, you create events (start +1, end −1), sort them by time and keep count of the active ones. The maximum is the number of rooms needed.
Instructions
- The first line has the number
nof meetings; thennlinesstart end. A meeting that ends at the same time another starts does not overlap with it. - Show
Rooms needed: n.
3
0 30
5 10
15 20
Rooms needed: 2
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise