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.
Check kata Details tab, near the bottom:
Print the input using
console.log
see why your code fails. The log appears above the test result.This comment is hidden because it contains spoiler information about the solution
The str.strip() method will actually remove all leading and trailing whitespace by default--including spaces, tabs, newline, return, and formfeed.
link: https://docs.python.org/3/library/stdtypes.html#str.strip
I don't think the perfomance gained from returning after 5 results is worth it in this case, the algorithm is still of the same time complexity, and I think it looks cleaner this way.
I took the same route with sieve of E and also tried atkins sieve, but thanks to this comment I was able to clarify a guess I had and the solution was obvious. Frustrating as hell to work on, but I can say that it's definitely a lesson learned when working with large numbers and what the JS engine can handle. Thanks for making me learn :D
Thanks! I'm really thrilled. This is one of my first top-solutions!
I can't say... What I can say is that the Sieve of Eratosthenes is possible but not needed.
JS? Console.log.
hi, how can I print the input from codewars tests?
I'm stuck and I feel also that my code is fine.
I have all test getting the right output except 2...
thanks.
Print the input and you will see it.
Might be some error in your code...