Ad
  • Custom User Avatar

    Probably you ran into an endless loop?

  • Custom User Avatar

    Huh. Very good to know. Thanks!

  • Custom User Avatar

    (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.

  • Custom User Avatar

    Ah, my mistake. I thought for a second that "BigInt" was predefined. Now I see your solution more closely.

  • Custom User Avatar
    • Need random test cases
    • Basically this kata. And basically any solutions there that doesn't use lots of strings will pass this kata too.
  • Custom User Avatar

    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?

  • Default User Avatar

    250 is the maximum, so it shouldn't be because of size.

  • Custom User Avatar

    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.