Hi guys, I have been trying to implement the Sieve of Eratosthenes to solve this problem but I am not sure I have done it correctly as I keep getting a TLE. What can I do to improve my code? Thanks.
code removed, SOLVED!
You can try this:
Only consider odd numbers:
rangeOfNumbers = list( range( minOdd, max+1, 2))
After sieve:consider prime number 2 if min <=2
Thanks! That helped, It was accepted!