Ad
  • Custom User Avatar

    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, as 12**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.

  • Custom User Avatar

    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.