Ad
  • Custom User Avatar

    I had many problems with tests timing out.

    Now that I have solved the kata (in Java) I can see the test code.
    It is the algorithm used there for factorization (every number is between 2 and n is tested for being a factor) which is most time consuming, my solution is more efficient.

    It's ugly when tests fail only because of inefficient test code. Test should be changed to be less frustrating.

    EDIT: Just inspected the tests in JavaScript. There only primes below 1000 occur and are provided hard coded in an array. That makes execution very much faster.
    In Java there is no limit, plus the factorization in the test is extremely time consuming.