Question 1

Company: IBM_28thjuly_2

Difficulty: medium

Problem Statement

Available Meeting Rooms An office has m meeting rooms numbered from 1 to m , and a list of n bookings that are already on the calendar. Each booking [roomID, bookingStart, bookingEnd] holds room roomID for the half-open time interval [bookingStart, bookingEnd) : from time bookingStart up to, but not including, time bookingEnd . You want to schedule a new meeting for the window [requestedStartTime, requestedEndTime) . A room is available when none of its existing bookings overlaps that window. Two intervals that only touch do not overlap: if one meeting ends exactly at time t and another starts exactly at time t , both can use the same room. Complete the function findAvailableRooms(requestedStartTime, requestedEndTime, m, existingBookings) , which returns every room that is available for the whole requested window, in increasing order of room ID. Input Format Line 1: the integer requestedStartTime . Line 2: the integer requestedEndTime . Line 3: the integer m , the number of rooms. Line