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.
work of art
Why this solution is marked as Best Practice?
It should not be in real production app: https://github.com/Codewars/codewars.com/wiki/Kata-Solutions-&-Voting#best-practices
thanks
This comment is hidden because it contains spoiler information about the solution
Thank you so much, I most certainly will be doing more reading!
Yes. :)
It's called a "ternary operator" if you want to look up more information about it.
This comment is hidden because it contains spoiler information about the solution
Nuts!
There must be a condition on very first part to check if n is non-zero or not. if non-zero then return it from there no need to go inside with non-zero.
Without this code is fine but seems applying condition would be appropriate THINK!!!!!!!!!!
this is O(n^2) right?