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.
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.
If I may ask - any reason why you chose this solution? Something about code speed maybe?
Man, this was messing with my head. Love your extra effort to work without loops! :)