FAANG Interview Question
Anonymous User
3072

There are K check up room in sequence (indexed 0 - K-1)in a long corridor and you are given the entry time of different patients and duration of check up in order.
The check up room is assigned on the basis of closest check up room available to incoming patient.
Once check up is finished it can be assigned again.
Find the check up rooms which catered to maximum number of patients.

Inputs:
numRooms: 3 = K
Appointment times: [1, 3, 5, 8, 19] => patients arrival time
Appointment durations: [20, 3, 2, 9, 1] => time spent by a patient in a given room

Comments (6)