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

    solution in 1 string :0

  • Custom User Avatar

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

  • Custom User Avatar

    why
    queue_time([2,3,10], 2)

    should return 12

    first checkout working 2 + 3 == 5 times
    and
    second checkout working 10 times
    10 biggest than 5 and should give 10. but correct answer is 12 :/