Deepak and primes II ,getting run error


the program runs fine for small inputs but gives run error for other test cases

2 issues in your code:

  1. have not handled the indices of array arr appropriately. it was accessing index equal to its size.
  2. elimination in array arr should start from a value which is close to m. otherwise time complexity will be nearly nlogn. but it should be (n-m)logn.

updated code: https://ide.codingblocks.com/s/218348

thanks