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 solution is wrong because it counts things like '>:D' and ':)-' as valid smiley faces. From the original description: "No additional characters are allowed except for those mentioned."
Some problems are inherently mathematical. And often, a mathematical solution is necessary, otherwise the computation is intractable. You might like to know that computers were basically invented to solve mathematical problems that had undergone 'mathematical transformations'.
Except that it's not a general algorithm. It still needs extra logic. Consider another situation where the ticket price in $20 and we have bills worth 10, 20, 50, and 100. When giving change for $100, one solution is to give back 4 $20 bills. But this algorithm can miss such a solution by giving $50 first and then realizing it doesn't have enough $10 bills to complete the transaction.