I am able to solve all test cases but the last one, which gives wrong ans. If I declare the array of bigger size, the time limit gets exceeded. Kindly check the code. https://ide.codingblocks.com/s/97235
Deepak and primes last testcase
@urvigoel26 hey urvi use sieve of erthothanes algorithm. this method will not work sieve is the more efficient.
there is a video in our content you can go through with the same name I suggested.
Sir, I am using the same algorithm as you said. But still the last test case is giving wrong answer.