3 / 3
Sep 2015

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!

  • created

    Sep '15
  • last reply

    Sep '15
  • 2

    replies

  • 1.1k

    views

  • 2

    users

  • 1

    like

You can try this:

Only consider odd numbers:

rangeOfNumbers = list( range( minOdd, max+1, 2))

After sieve:
consider prime number 2 if min <=2