Ad
  • Custom User Avatar

    You can see from the second example the order is left to right:

    queueTime([10,2,3,3], 2)
    // should return 10
    // because here n=2 and the 2nd, 3rd, and 4th people in the 
    // queue finish before the 1st person has finished.
    
  • Custom User Avatar

    I was confused by this as well! The queue reads left-to-right and not right-to-left.

    The front person in the queue (i.e. the first element in the array/list) proceeds to a till as soon as it becomes free.
    
  • Custom User Avatar

    2 and 3 go to different tills. Read the description again.