Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Description should be language-agnostic
I think it should be 8 Kyu
JS: Node v12 should be used along with the appropriate assertion tools (Mocha + Chai)
'alr approved some time ago'
Hi, I made a C# translation for this Kata.
Approved
Yup... thanks!
Five random tests seems to be added now, feel free to ping me if you think this is a mistake :)
Needs random testing.
I was 24 hours awake before and didn't realize. Thanks by the way :)
50 is also could ba used as a change, 25+50 is a valid change for 100, so "YES"
This code has an issue in that it can create both false positives and false negatives as it has no understanding of how making change actually works.
[25,50] is supposed return "YES" because when the person with the 50 comes in, the clerk has $25 in change they can give and that's exactly how much change is needed. However, the comparison listed under any() will say "Is 50 greater than 25? Yes, so I must be true" and thus tells elif to execute its code, which returns "NO".
For [25,25,50,50,100], on the other hand, it should return "NO" because by the time you get to the person with the $100 bill, you've given out all of your $25 bills already so you can't possibly give change. However, any will check "Is 100 greater than 150? No. Since there's nothing that meets the condition I'm looking for, then I must be false" and tells elif that it can skip over its code, and the code then executes the return for "YES".
I failed on some random tests like this, because I think there's something wrong.
Line = 25,25,25,100,25,25,25,100,25,25,25,100,25,50,25,100,25,25,50,100 - Expected: 'YES', instead got: 'NO'
(25,25,25) I get 100, then use the three 25 for change. Same thing twice. So I get 300.
+25, I get 50, then use the 25 for change. No 25's left, then I get 25. Someone pays 100. I would be able to give change, so 'NO'