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.
What I learn in this kata:
I don't know what language that you currently use now, but I can give you a hint for Python.
I hope it help!
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!