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.
old 4 kyu -> now 6kyu
Your solution is O(N) + O(N) + O(N^2) in which the kata can be solved with an O(NLogN) algorithm. Read about how the
step
helps in deducing the output primes.AFAIK, it's because i64 implements the trait Ord, which contains those methods.
This comment is hidden because it contains spoiler information about the solution
That's because you dont need the parenthesis inside the brackets (character set)
Changed to more than 2 strings.
Great use of the range function. Creating a range function is O(n) right?
Yes, runtime on this solution will be n^2 since they are entering every number 1 by 1 and it's an N * N table which means N^2 items will need to be entered.
Other languages (e.g. python) have examples with three strings.
IMHO examples are correct and description should be "at least 3 strings"
Please mention the language you're talking about when reporting an issue (if the kata has more than one language available ofc).
Did You solved the kata? I'm not a JavaScript expert, but the
IsPrime
function looks OK to me. To spead up your code just find the first prime number addstep
to it and if it's a prime then You found the result.