Deepak and prime problem

For 2 out of 6 test cases, code is giving wrong answer. Please tell where the code is wrong.

@poorva2145 share your code on ide so that i can look at it.

Thank you.
But I figured out the problem.

No problem
Feel free to share any doubt

Mark the doubt resolved if satisfied

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.