Ad
  • Custom User Avatar

    I suppose that explained

  • Custom User Avatar

    Because you didn't sort it properly. Should be sorted by points: descending (you have ascending) - its not written directly but you can show it in example.
    And if points are equal should be sorted by name.

  • Custom User Avatar

    You are completly right, i will do it again, thanks :)

  • Custom User Avatar

    Why do the results have to be 10 or 12?
    In both the cases first two clients would occupy both the windows, thus adding 2 seconds or 6 seconds respectively.
    When both the clients are finished, the last client would start, adding 10 more seconds.
    Thus, the result would be 12 or 16 seconds respectively.

  • Custom User Avatar

    I forget that it's not recommended to jump from the queue.

  • Custom User Avatar

    Hi, the front of the queue is the first element in the array, so it should be:

    Test.assertEquals(queueTime([2,2,10], 2), 12);
    Test.assertEquals(queueTime([6,6,10], 2), 16);
    

    Let me know if you have any further questions. I may add an example test case like these, as a few people seem to be having similar confusion.