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.
This comment is hidden because it contains spoiler information about the solution
Where does your "50" come from? Don't forget that a number of inhabitants is an integer.
j = False
gets executed. So, j is never False. And your function fails.This comment is hidden because it contains spoiler information about the solution
I just wasted my time trying to solve this kata cryptic description in Ruby
This comment is hidden because it contains spoiler information about the solution
how can i do this? problem is in python i don't know how to exclude the case where name == () it return TypeError. i tried with a try/except
ty guys ^^ i think i managed pretty well with the code i presently have i just modified it a little. I'm a beginner so if you want to tell me to do something try to keep it stupid and simple because raulbc777 i did not understand what you told me -_-'
We were answering simultaneously CrazyMerlin. Sorry for that!
You're generating two lists of primes. Why? This will cost you a lot of time. When you have a problem of prime numbers you generally may have two situations:
you need a fast prime generator and in some cases to check if the number is prime, but will be used only once per run
you need a fast primality test checker like Miller - Rabin or others, this kind of test cost a lot of time. It should be used carefully and conveniently.
Try to optimize your code. Use spoiler to present your solutions!!
Calculating all primes below n will take too long no matter how much you accelerate it.
Maximum of the primes smaller than n is the one closest to it.
You don't need to check numbers lower than that.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
same problem here