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.
This comment is hidden because it contains spoiler information about the solution
Empty your mind.
Now recursion can flow or it can crash.
Be recursion, my friend)))
how did 0 + 3 + 2 + 1 equal to 5?
Coming from Haskell, I find it hard to use loops (even though I've used JavaScript for two years before learning Haskell). When I started solving katas in JavaScript, I kept on trying to use recursion instead of loops because it was faster. But soon learnt that it's not.
how would you find n?
I understand, Thank you!
Generally you'd want to avoid recursion in JS since it functions by adding additional calls to the callstack and that can cause a crash if the input is large enough. As far as writing production code goes I've only ever used recursion a couple of times to traverse tree like structures. Hope this helps!
i'm a beginner and wondering,is it the best practice to use recursion in general where possible?
It seems like a more complicated concept so if you have some begginers in a company it would be more confusing.
If your range is large enough, this recursion exceeds maximum call stack.
"Best Practices" - with recursion? mmm....
can you please explain sequenceSum 1,3,1 how it calculate?
thanks
This comment is hidden because it contains spoiler information about the solution