Ad
  • Default User Avatar

    The real problem is that the JS version should be updated to match the java one... And so earn it's 3kyu rank. My solution does the job, in Java. You just have to find a more efficient algo.

    (that reminds me I still have to update the python version... :/ )

  • Custom User Avatar

    The algorithm you're using (at least for JavaScript), is incredibly slow. If you're using an analogous solution for bash, it's thoroughly unsurprising that it's not completing in time, given it's bash. Even the 'top' solution in JS is about 15x faster than what you've got, and it's quite a slow solution. I don't think it's really reasonable to force the kata maker to have set the bar so low that literally any solution will finish in time.

  • Custom User Avatar

    Too many tests for the time limit in Java. Even with really efficient code it always times out after passing everything initially. The Javascript version worked just fine.

  • Custom User Avatar

    The bash shell version needs more time to calculate. The algorithm i am using passed when written in other languages but in the bash tests it seems like the numbers in the test are too big or something. The code is very short. The first 8 basic tests pass then it times out.

  • Custom User Avatar

    If you read the comments, you will see that the tests go up to 10^12(!), for which you need an efficient prime checking method. As suggested below, the ranking of the kata should be changed or the test range should be lowered. In its current state it's not a 7kyu kata, rather a 6 (or 5).

  • Custom User Avatar

    I can't get the attempt to go through. I tried a few good algorithms already. Everything passes for all the algorithms but there's just not enough time to complete everything. 12 seconds isn't enough time. Process was terminated. It took longer than 12000ms to complete