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.
Read about
sieve of eratosthenes
What does your function return for negative numbers like -3? Read the description again. Also, printing the input would help you debug your code.
First of all, your code is almost unreadable because it's all on one line. Format it properly as shown here https://docs.codewars.com/references/markdown/#code-block
Secondly, from description:
Why are you bothering with negative numbers then?
It also looks like you got some flawed logic in your
else
statement, but it's just a guess because, again, your code is unreadable right now.This comment is hidden because it contains spoiler information about the solution
In VS it works. But here no, i can't understand
This comment is hidden because it contains spoiler information about the solution