I was the attempting the PRIME1 Problem in the medium section. My code is compiling and running successfully. However, it is not getting accepted as the code is giving the wrong answer for some input. I am not able to find out for which test case it is giving the wrong answer. So please help me, I am new here.
Here is the link to the problem:
And here is my solution: Solution