Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Thanks those who have helped explain the kata!
@arssonist, I can't really give any explicit hints or it will ruin the fun of completing the kata... ;)
But how do U do this? Reasoning it out is not that hard, but knowing how to make the code do it is another.
Any concrete hints? Not explanation about the basics of the problem. (I realize this question was not answered for me but still, thought I'd try and get some info anyway)
You don't have to be CS guy to understand this. Let's check the 1st case
queue_time([5, 3, 4], 1)
Imagine
[5, 3, 4]
is the costumers who want to go to checkout's queue. The 1st person need 5s, the 2nd person need 3s, and the last one need 4s.The number
1
isn
, which its mean the number of queue.This is the scenario:
1
, since nobody in there.The total time?
5 + 3 + 4 = 12
.Now, let's take a look at 2nd case:
[10, 2, 3, 3], 2
This is the scenario:
Total time? 10s
How about the 3rd case?
Well, you can guess actually. By judging the number, you can see that the 1st person and the 3rd person will eventually goes into the same queues.
So, the total time is 12s.
I hope this help!
You should return with your function how long it will take for all the customers to check out. The first argument will bring you a list of how long each client will take. The second argument will tell the amount of queues available.