• Custom User Avatar

    Your solution should work even if you don't know those parameters.

  • Custom User Avatar

    What is the range of input for n, size of the array, integers in the array?

  • Custom User Avatar

    Ah, I got it. Thanks mate!

  • Custom User Avatar

    There is no "optimal" answer to the tests, there is only one possible answer for each test. You cannot rearrange the customers in line to take the shortest amount of time possible, you have to process the queue in the order that it's given to you. Just like in a real supermarket, they check people out in the order that they come to the registers. With that said, your code has a lot of issues, mostly because you're changing the order of the queue.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This one had me stumped for quite a while, but the solution ended up being super satisfying. Great kata!

  • 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.

  • 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 :/

  • Custom User Avatar

    Very interesting Kata! Thanks to author!!!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Very nice kata to solve!

  • Custom User Avatar

    as far as i'm concerned, i dont care about how clean the top solutions are. what's important is that i was able to solve the prob, and it has the same time complexity as the top solutions... don't care about anything else. I think you should just enjoy the fact that you were able to solve the problem with good time complexity. as for ur other comment, i don't think it's that impressive, and nope i ain't got experience already.ido think anybody can do it, just focus and take challenges as an opportunity to learn... thts my strategy

  • Custom User Avatar

    Btw you are 6 kyu by just solving 55 kata, which is rare and impressive.
    Did you already have experience before you started codewars which helped you solve higher kata(more score point) earlier and rank up quickly.

    Or were you beginner and yet you just went ahead and solved higher level kata.

  • Loading more items...