Ad
  • Default User Avatar

    This is a bad solution and it will not work in case the max number is prime and greater then 1000. Because of inefficient code I had to reduce the number of prime numbers generated, but by removing the first if statement the code will work for any case, although it might be slow for big numbers.