Cannot understand how to approach

My thought for this problem was that i would create an array of prime numbers till 10000 and then i would ask for input. first for test cases and then for the primes required. Suppose the input for the prime was 3 then i would match 3 with the index 3 of the array and output the corresponding prime number stored in the array. Can the TA explain if my approach is good or provide me with some other approach?

@ankush.bhardwaj hey ankush there is an video on prime for large input in our course content. I recommend to watch it first video name is sieve of eratosthenes if solve this problem without this algorithm you will get time limit exceed error

Okay so this problem can be solved only by using that algorithm.

@ankush.bhardwaj0 yes this question is design to teach students how to implement prime sieve
so go through sieve of eratosthenes

Alright! Thank you for the information.

Hey Ankush,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.