Deepak and primes

2 test cases getting failed

@rockstarpkm this is not the right approach to the problem. Use seive for precomputing the primes and query in 0(1) time

I tried doing each query in o(1) time, still 2 test cases getting failed.

Is it tle or wrong answer?

runtime error. Do check the code I’ve written in code comments.

Okay I will check it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.