iamantony / CppNotes

My notes about C++
MIT License
1 stars 3 forks source link

Hotel visitors #25

Open iamantony opened 6 years ago

iamantony commented 6 years ago

You have unordered list of pairs of days numbers - days when hotel visitor arrives and leaves ({1, 4}, {6, 8}, {2, 4}, ...). Find out max number of visitors that lived in this hotel at the same time. If at the same day one visitor leaves hotel and another one arrives, we must assume that on this day only one visitor lived in hotel room.