Ad
  • Default User Avatar

    failed even for {25, 50}

  • Custom User Avatar

    This solution is not correct; it is made assuming that the clerk can exchange the receiving 50 and 100$ bills into 25$ bills instantly, which the description clearly states that he can't. It just passes the tests because they don't check for bill amounts, just for the final result. It probably wasn't coded for this, but it cheats the tests. The tests need a revision, and this answer should be removed.

  • Default User Avatar

    I came up with a VERY similar solution that was just structured differently but could not pass all the tests.
    I think I see how jpryciak was able to make it work but I threw out the idea and came up with another solution.
    If this works under more extensive testing then I'd be surprised.

  • Default User Avatar

    What a defalcation!!!
    despite of kata, just look at bank:
    it is obvious that if three people buy three tickets finally should be 75 dollars in bank...
    but in this algorithm after a [25 25 50] sequence we have only 50 dollars in bank, !!!
    As what happened in algorithm: 25 + 25 - (50-25) + 25 = 50 !!!

  • Custom User Avatar

    What about 50s given as change to 100s?

  • Custom User Avatar

    This code fails for even the simplest test: [25, 50] => YES

    The set of test cases needs fixing on this kata!

  • Custom User Avatar

    25,25,25,100 should return YES, this code returns NO

  • Default User Avatar

    As UKS notice, this solution should not pass.
    If you use the following entry :
    int[] peopleInLine = new int[] { 25, 25, 50, 50, 50 };

    The correct answer is "NO". When the last person want to pay; we only have 50$ bill; so we are unable to give back 25$
    But, when you launch this code; it will answer "YES".

    I check this code with the submite button. It really success in passing the test.
    I think; it lack some test that will show that this code is failling.

  • Default User Avatar

    Best solution. But the "continue;" is not needed.

  • Default User Avatar

    I think it's good .Thinking more,coding less.

  • Custom User Avatar

    This solution must not pass! Looks like author didnt write correct tests for such solutions.
    (its using in bank only 25$ money, even if people giving 50$ money or 100$ money)