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.
There is O(1) solution for two coins (with O(c) preparations, where c is value of greater coin).
It also exists for three coins, but that's where calculations start getting... complicated.
I made another update to finally fix the last remanants of this testing error.
When I was done whittling down the requirements, one of the randomly generated solutions spat out that it didn't expect a leading 'yī' character for a shí following a 'bǎi' character. Figured this may have been incorrect. Tried submitting again and it worked.
I would prefer radix too.
Any variables declared with
var
are not properties and therefore are not able to be discovered by looping over the object's property names. This kata takes advantage of that, forcing you to brute force look for the variable.No problem. I hope you enjoyed solving my kata :)
The return value of the deliverLine function is the deliverLine function, so (in my mind at least!) it's being called twice.
You are right, Nebril! I had missed that test case: The yi character is dropped only for values in the range [10-19], larger values will not drop the character. I have added two more test cases to verify that situation.
This is an intermittent issue that keeps popping up. We haven't gotten a chance to look at it yet. I re-validated all of the solutions and it looks like everything is good now.