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
@chrono79 Can you explain this a bit better to beginners like me? Thank you.
This comment is hidden because it contains spoiler information about the solution
Setting
"a"
value to 1, and so on.factorial of 0 = 1. So if n = 0 then we return 1
you're reversing the number which is now an array split into each digit. by reversing it you start from the 1's digit allowing you to increase digits with the index, so since we are increasing by digit, we can multiply by whatever 10 ^ i. the filter is simply filtering out the cases where the digit is 0, like in 2034 you would filter out the hundreds digit because if you didn't, the return would be 2000 + 000 + 30 + 4.
This comment is hidden because it contains spoiler information about the solution