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.
I came across this which inspired me to experiment with it.
https://www.kaggle.com/chefele/scripts-first-try
Faster than my attemp, damn that's insane...
I think this belongs to 5kyu. All mathy problemy thingys are 5kyus (except for hard ones, they are probably 4kyu). Cuz 3kyu is already machine learning (according to the official Codewars ranking system), which I think is harder than algebra like this.
both answer is correct.
also found that @FArekkusu's function returns primes < n. It would fail at n = 7, n = 17, etc.
I just had a quick look and yeah, it's basically the same. Just that @FArekkusu used a more efficient approach (subscript assignment to the list
a
thereby replacing thefor
loop you used in yours) to implement it.Wait...that's just my starting algorithm!
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
And here he comes to steal the show.. lol.
Nice work here. I'm trying to wrap around the algorithm. Kindly explain. Thanks!
Ordered by speed:
So, yes, this one is the quickest.
[deleted]
[deleted]
Yeah, this one's proably the est one so far. It's very concise and fast.
You're welcome
Oh, I think this is the most efficient algorithm I saw here so far! I was considering adding 1 million to the test cases, but my algorithm was too slow. Thanks!