Ad
  • Custom User Avatar

    @hobovsky I'm obtaing the test cases with a simlple for loop inside the function just to see what the lines that are failing my tests look like so I can debug it in a local environment to make sure my code does not commit any mistakes.

    for (auto i: peopleInLine)
    std::cout << i << ' ';

    Are you aware if this type of code (the for with the cout) has any issues printing the test cases?

  • Custom User Avatar

    Hi guys! So I'm having trouble with the following test:

    { 25, 25, 50, 50, 25, 25, 25, 25, 50, 100, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 ,25, 25, 25, 25, 50, 100, 50, 25, 25, 50, 100 }

    I've marked the post as a question, hesitating if it an issue or probaly a my missundestanding of the problem. So the test is expecting a "YES" for this test case but, and here is my question, I don't understant why it is expecting this result. So from the 10th position of the array there are 11 "50"s in a row, and you run out of "25"s bills to give back. You have only received 6 so far in the queue and already gave back some for previous customer.

    Another similar test that expects a "YES", starts with a 50 which would be automatically a "NO" since we don't have any bills yet go give back.
    (50 25 50 25 25 25 50 25 100 25 50 50 25 25 50 25 25 50 25 100 50 25 50 25 100 25 25 50 50 25 25 )

    Any help will be aprecciated. Language is C++.

  • Custom User Avatar

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