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.
@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
This comment is hidden because it contains spoiler information about the solution
Setting
"a"
value to 1, and so on.sum += arr[i].charCodeAt(j) - 96; Whats the function of 96 in this code ?
factorial of 0 = 1. So if n = 0 then we return 1
what does the ': 1;' on the return statement mean ?
Thank you.
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
This comment is hidden because it contains spoiler information about the solution