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.
This comment is hidden because it contains spoiler information about the solution
well if you import the whole library like this solution your program gets a little bit slow and when your working on a large project libraries are the most efficient way.
Thanks benjaminzwhite, your explination helped me.
Ah, yes, I hadn't accounted for there already been somebody at the till. Cheers
Draw a picture - look up "Gantt chart" or "scheduling diagram" - represent time horizontally and create a row for register machine #1 and create a row for register machine #2.
Now, when 1st person arrives, let's say they go to (available) machine #1. Draw a horizontal bar of time = 2 units in row for machine #1.
When 2nd person arrives, they go to the only available machine, which is #2. Draw a horizontal bar of time = 3 units in row for machine #2.
When 3rd person arrives, both register machines are occupied, so they wait until any machine becomes available. This in our case will be machine #1, since 1st person will finish in 2 minutes, while 2nd person will finish in 3 minutes. So draw a horizontal bar of time = 10 units, representing 3rd person, in row for machine #1.
Now look at your drawing and see how long the longest horizontal line is.
Can this be explained please?
Bro I missed that too:-)
This comment is hidden because it contains spoiler information about the solution
can any one explain the third example in problem description code
queueTime([2,3,10], 2)
// should return 12
I didn't get it, how it return 12 plz explain
oh! right, thankyou so much, how did I miss that 🤦♂️
This range goes from "minus 3" to "plus 1" so "-3-1" in the sample solution is correct!
why no?
solution([-10, -9, -8, -6, -3, -2, -1, 0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 17, 18, 19, 20])
this should return
returns "-10--8,-6,-3--1,3-5,7-11,14,15,17-20"
but returns returns "-10--8,-6,-3-1,3-5,7-11,14,15,17-20"
the -3--1
is just given -3-1
instead of saying just no , could you explain?
No.
This comment is hidden because it contains spoiler information about the solution
actually my code is lot longer and more basic looking than this one, but took less time to execute, just saying.
but I like the use of libraries too, but we can't predict some times if it can be efficent
Loading more items...