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.
Please, when posting code always use the spoiler tag and correctly format it (using a starting and ending triple backtick).
I tried to reproduce the case you linked, but the
Expected
value is correctly given (1): you can also see it by yourself, as12**836==144**209
. Also, I think you missed the point that in this kata you have to return -1 if the first argument is bigger.Finally: very creative solution, but I doubt that is always going to work.
so your solution only deals with fs[1] and fs[0], meaning that fs is an array of 2 functions. But what about if I want to chain 10 functions? or 1? or 0? or 5?
Your solution doesn't work for any number of functions that may be in the array of fs.