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.
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... :/ )
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.
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).