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.
Genralized tip:
You'll fail all the test, but usually you'll see the input. (Except, as you'll discover here, not always.)
Often this will help you find out the count of tests. (Although, again not always.)
I was able to reach 65 tests, but still timed out. I suspect we're using the same algorithm (but I've optimized mine as much as possible). I have in mind another algorithm which I think may be faster, but don't have time to implement it at the moment. I'd encourage you to try a different approach. 232 people have solved it in Python, so it should be doable.
No spoilers, sorry. :)
correct me if i'm wrong,
but the challange here is actually mapping all primes up to given number in an optimized way.
i know i have an efficient method, but it still isn't good enough to pass in given time.
(going through odds only, using bitwise,etc.)
it seems like there isn't a wide range of deviation from a specific code to succeed.
no space was left for discussing solutions, best practices, algorithms - either you got it or you didn't.
well... i didn't.
and the only ones that can discuss it probably did almost the same.
no one can learn from no one here, although it could be a very good well to drink from.
please think about softening a bit the requirements, allowing some that almost passed to succeed and learn from better coders.
hi there!
my code passed 55 (example + short), but T.O in large ones.
running python.
already O(log n), and not sure how to reduce it further.
was it tested using python on servers? can it get better than O(log n)?
edit:
on my 6y.o laptop i get 50 tests of 106-digits in split of a second:
number: 1234567890123456789111111111111111111111111111111111112345678901234567891111111111111111111111111111111111 size: 350 array: [1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1]
Action took 0.00 seconds
how big are the big numbers?
thank you! :)
Also, you might wanna search it up on wikipedia, if you don't succeed yourself. There's a nuance that could potentially not let you pass.
O(n*sqrt(n)*m) per entire test suite, where m is the number of tests isn't supposed to pass. Gotta reduce this somehow. Remember about the upper bound.
while my code is correct, i keep failing at test 10# on timeout.
is O(n*sqrt(n)) supposed to be good enough?
the idea is sweet, but thetesting is quirky.
normalizing signals should take in consideration one might appear as another.
there should be a convention of how to start messaging, orregarding message requirements.
got that too in python.
i print the message before returning it, and it's the same.