+ 1
Eratostanes
So. most of the challenges revolve around prime numbers, and I read that interviewers frequently ask how you would list prime numbers in a code, so I looked it up and found this little code based off the sieve of Eratostanes. The code works and I added in user input and changed some vars, but what is the "return>1" at the end actually do? https://code.sololearn.com/Wy0DdPspMnJM/?ref=app
1 Respuesta
+ 1
It returns true if n is > 1, otherwise it returns false