Ad
  • Custom User Avatar

    Just a regular JS :)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I thought this kata is impossible to solve in JavaScript due to performance limitations.

    I spent three days trying different approaches, using some tricky optimization approaches...

    ...just to find out that this kata is way easier than I thought, and it even leaves some reserve in running time.

    So it it is even possible to get rid of some optimizations (like bit shift for multiplication) and still generate even more than 25e6 primes.

    So I managed to golf it down to 136 characters.

    In the end, that was a lot of fun, I played with different performance tricks (most of them turned to be insignificant though).

  • Custom User Avatar

    Statement says:

    If a number is shorter, it will be zero-padded.

    Though in random tests this rule is not followed: shorter numbers are not zero-padded.