Ad
  • Default User Avatar

    I stumpled over this myself. No, you have to try to exchange the 100$ bill with a 50$ bill and a 25$ bill first and if that is False exchange the 100$ bill with 3 25$ bills. If you prorize in that order your code will work.

  • Default User Avatar

    Oh stupid me, of course you are right.

  • Custom User Avatar

    After the first person buys a ticket the clerk has 1 25 bill
    After the second person buys a ticket the clerk has 2 25 bills
    After the thirs person buys a ticket the clerk gets one 50 bill, gives back a 25 bill and ends up with 1 25 and 1 50 bill
    After the fourth person buys a ticket he gets a 100 and gives back the 50 and the 25 he had, so now the clerk has 1 100 bill

  • Default User Avatar

    test.assert_equals(tickets([25, 25, 50, 100]), "YES")

    1 +25 = 25
    2 +25 = 50
    3 -25 = 25
    4 -75 = -50

    There is something wrong with this test case.