Company: Curefit_27july
Difficulty: medium
Doctor Problem Description Suppose there is a doctor's office with a single physician. You are given an array of patients, where patients[i] = [arrival, time] . arrival is the arrival time of the i-th patient. The arrival times are sorted in non-decreasing order. time is the time needed to examine the i-th patient. When a patient arrives, he joins his companions in the waiting room. The physician starts examining him once he is free. The patient waits till the physician finishes examining him. The physician examines patients in the order they were given in the input. Return the average waiting time of all patients. Return the answer rounded down to the nearest integer less than or equal to the answer. Notes: The physician examines only one patient at a time. The waiting time includes the time he spent with the doctor. Function Description Complete the function solution() provided in the editor. The function takes the following 2 parameters and returns the solution. N : Represents the n