link to my code
Solution is obtained by using prime sieve method still for one test case TLE is there.
link to my code
Solution is obtained by using prime sieve method still for one test case TLE is there.
@vishaaltiwari1999
your code is giving TLE because you are iterating till 1000000 for each testcase which require large time if no. of testcases is greater than 1000. So better is store all prime_numbers in some array and for each testcase print prime_number[num-1]. I have made few changes in your code, plz check here