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.
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".