Sobes.tech
Junior — Senior

Finding the maximum number of guests simultaneously in the hotel

livecode

Task condition

Given an array of pairs, where each pair represents the check-in day and check-out day of a specific guest. It is required to implement a program that determines the maximum number of guests staying in the hotel on the same day.

Example input data: {0, 11}, {0, 2}, {1, 3}

{0, 11}:

  • check-in on day 0
  • check-out on day 11

The program's answer is the maximum number of guests staying simultaneously.