Meeting Rooms Allocation Problem Statement

Stark Industry is planning to organize meetings for various departments in preparation for Stark Expo. Due to limited rooms in Stark Tower, the goal is to allocate meeting rooms such that all meetings are organized using the minimum number of conference rooms, ensuring that at any given moment, only one meeting occupies a room. Your task is to help JARVIS, who is preoccupied, by determining the minimum number of conference rooms required.

Explanation:

You are provided with an array ARR of size N x 2, where each pair represents the start and end time for N meetings. Compute the minimum number of rooms needed to conduct all meetings.

Input:

The format is as follows: The first line contains an integer 'T' indicating the number of test cases. For each test case, the input includes: 
 - An integer 'N' that denotes the number of meetings. 
 - A second line with 'N' space-separated integers for the start times of these meetings. 
 - A third line with 'N' space-separated integers for the end times of these meetings.

Output:

Output a single integer for each test case, representing the minimum number of conference rooms required. Each output should be on a new line for different test cases.

Example:

Consider the following meeting schedules: 
1pm - 4pm
3pm - 5pm
4pm - 6pm
For these schedules:
- Meeting 1 takes room 1 until 4pm.
- Meeting 2 needs a separate room as it starts at 3pm.
- Meeting 3 can use room 1 after meeting 1 concludes at 4pm.
Thus, a minimum of 2 rooms are required.

Constraints:

  • 1 <= T <= 100
  • 1 <= N <= 1000
  • 0000 <= INTERVAL[start][end] <= 2359
  • Ensure solutions strive for linear time complexity.

Note:

All meetings are assumed to occur on the same day. If a meeting's starting time coincides with another's ending time, it can proceed in the same room.
Be the first one to answer
Add answer anonymously...
Urban Company Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter