← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given a list of customers and a list of agents. Each customer has an arrival time and a service duration. Each agent can serve only one customer at a time. When a customer arrives, they are immediately assigned to the agent that will be free the earliest. If multiple agents become free at the same time, the agent with the smallest index is chosen. Once an agent starts serving a customer, they work continuously for the entire service duration. Return a list indicating which agent served each customer, in the same order the customers were given.