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.
Probably you ran into an endless loop?
Huh. Very good to know. Thanks!
(I was lazy so I just took one of the solutions from that kata directly.)
Also, for the record, you can
require('bignumber.js')
to automatically get bignums. Bignum calculations used to be funny, but it's already become pretty boring.Ah, my mistake. I thought for a second that "BigInt" was predefined. Now I see your solution more closely.
That speed was not entirely accurate (1300ms for n=2500). But regardless, I timed 13ms on my local environment to calculate factorial(250), and I still time out. Is that entirely too slow, or is there something else responsible for the error I'm getting? What speed should I be shooting for?
250 is the maximum, so it shouldn't be because of size.
How big are the n's they're giving?! My JS code can calculate for n upwards of 2000 in a couple milliseconds, but when I 'ATTEMPT' on here, I pass all the tests, but it keeps giving me an error because it times out.