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.
That's not how u write list comprehensions tho. Maybe https://www.programiz.com/python-programming/list-comprehension can help u out~~
ah yes, I see what you mean! thanks
I think it is talking about @Pink Ghost's solution.
not sure if I understand what you're saying, but if that is the case, I would like to know what programming language more than 2000 coders used to solve the python translation...
Your arrays are so big that Python has no more ressources to answer.
Be sure that there are tests to be run.
If there were problems in the Python version it would have been impossible that more than 2000 people passed it; it is for that reason that I considered the issue as resolved all the more that I tried several Python solutions without problem.
Maybe you should look at your code... I think the Sieve is too much for that kata; see the array you need when n is big...
PS1: (https://github.com/Codewars/codewars.com/issues/879) -> seems to be a corporate problem. It is not the case for your solution since I get the same result as you when I try it.
PS2: Downvoting my post because you are not happy with it doesn't seem to be from a "Sorbonne University" student. I could downvote yours because I waste a lot of time to try your solution as well as other ones.
Bonne journée et bon courage !
Which language? I suppose it is Python. Not a kata problem. 2110 people passed the Python kata. I tried a few solution and they worked fine.
See the input for those tests, they're negative numbers, your code is failing with them.
Not a kata issue, read the instructions more carefully:
It's a problem with your code, use Question for things like this.
Are you seriously writing Python code in 1 line? You can't do that.
You have several problems with your code, but it isn't entering the if because its condition is wrong, either try
if char in dict_list:
orif (char in dict_list) == True:
. Try to figure out the other problems yourself and if you can't ask again.As I said,
n
is not always an integer. As an argument you can receive: a number, a boolean, a string. Your code should handle this correctly.n
is not always an integer,n > 1
does nothing, your loop is instantly returning the result without running more than once (you don't even need it if you're using math).You return some arbitrary integer on first iteration of the loop, whereas the task is to return a string of
0
's and1
's.