Ad
  • 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!