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.
Wow.... regex
OMG Congrats it's incredible
OMG, I didn`t know that there is such an easy way to deal with it.
I spent half a day solving this kata, and when I finally found out the solution, I was surprised by the simplicity. Just imagine that you have just started programming and the solution to this kata will come by itself!
i've spent so many tyme on this kata. So many paper to find a solution.. counting tens, pows, fives... I found working algorithm, but this did not pass timing test.. Et voila, ok. google, how to find zeroes in factirial, 4 lines of code and i can submit it. Kind a disappointment, but it was exciting: this all calculation on paper, testings.. Thanks for this kata however.
cool
Check the hint at the bottom:
aight thx
There are two problems with your solution:
n = 30
,30!
has 32 digits but JavaScript'sNumber
can hold ~16 digits at most. When your values get larger than 16 digits, the least significant digits are lost and you cannot use them reliably for this problem.n
can go up to1_000_000_000
. Calculating1_000_000_000!
will take forever, and your naive solution will not work because it will be too slow, and will eat up whole available memory.You need to find some better approach than calculating the exact value of the factorial.
oooooo clever
What I did............
Good copy paste training, the hint is over powered ;p
Not a suggestion. Please do not post hints without a spoiler flag.
This comment is hidden because it contains spoiler information about the solution
facepalm
Loading more items...