Ad
  • Default User Avatar

    Please before posting issues look at the top of the page so see how many people passed the kata in your language (111 in R). When this number is high chances are that your code has problem.
    Your STDERR is a time out: your code is too slow: not an issue.
    Your code get:

    STDERR
    Execution Timed Out (12000 ms)
    

    In fact you time out for 25 tests and there are 225.

  • Default User Avatar

    It's a great feature of R ;)

  • Default User Avatar

    No, it just felt natural to me. Fibonacci has always been a prime example for recursiveness, so it was obvious to me to use recursion here too.

    As a matter of fact, depending on how R handles function call stacks and function invocation overhead, it's most likely less performant than other solutions. But (at least to me), it's just more "elegant" to read and clearer to understand the algorithm behind it.