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.
Nice work on the recursive approach.
It's a clever solution. Just a heads-up,
the time complexity of this function is O(desiredHeight)
Well, I got the answer but it took me a bit of time to understand why my answer is right :P
The 10 chair example wasn't enough so I used that to visualize the answer for 1 chair, 2 chairs, 3 chairs, 4 chairs, 5 chairs.
Using the given rules, a pattern comes about and that was it.
Interesting...
this helped.
👏
Thank you! Your comment helped me solve this instantly.
I like this solution a lot!
100% this! This should be the updated description.
Thanks for your help.
100% agreed, thanks for clarifying the description!
For me the most difficult part was trying to understand the description.
The descriptions should be simple, something like:
This is so cool! thanks!
Was testing your function and noticed that it gave me a bad access error, probably due to the recursion depth, when calculating
factors(100_003)
. That said, I appreciate the way you thought of this recursively, very smart.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...