Ad
  • Custom User Avatar

    if he initially has no money and sells the tickets strictly in the order people follow in the line?

  • Custom User Avatar

    I realized after many attempts that the key to everything is to keep track of the nr of banknotes and not the change available.

    Anyway, these should be useful tests to run your sw against:

    tickets([25,50,50]) > 'NO'
    tickets([25,50,25,50]) > 'YES'
    tickets([25,25,25,25,50,100,50]) > 'YES'
    
  • Custom User Avatar

    I wrote the programing assuming values rather than actual physical money as change, and passed all but test 6. I assume that it allways gives values as 25, 50, or 100; my code does return "NO" if any value is not one of the 'valid' values, I can not say for certain if test 6 is broken or not, but I do wonder what it actually passes so that way I can detemin rather or not it is an issue with my code (which I find more likley) or simply that they meant it to return oppisite of what the told it exspect.

    I wrote the program in Java and failed the 6th test and passed all others.