Ad
  • Custom User Avatar

    The test is good but the log is not clear: you return 10, and the test wants 12. So 10 != 12, which is wrong. Revise your code :)
    A clearer log would be: expected 12, instead got 10

  • Default User Avatar

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

  • Default User Avatar

    This is "YES", all tickets can be selled!

  • Custom User Avatar

    yes, i got my mistake, sorry
    i didn't notice that 50 or 100 is only one bill and used it for example like '100 - 25 = 75'

  • Default User Avatar
  • Custom User Avatar

    All those tests are ok, in the first one you can't give change to the last customer with a 50 dollars bill, the second, the last 100 dollars bill and so on.

    Can Vasya sell a ticket to every person and give change if he initially has no money and sells the tickets strictly in the order people queue?

    Return YES, if Vasya can sell a ticket to every person and give change with the bills he has at hand at that moment. Otherwise return NO

    Read that again, it seems you're grabbing all the money and then giving the change when you should give change to every customer in the order they come.

  • Custom User Avatar

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

  • Custom User Avatar

    The test is ok, your code is wrong. Read the posts below. Think how you give back the change.

  • Default User Avatar

    [25, 25, 25, 25, 50, 100, 50] 'NO' should equal 'YES'. It's test wrong.