https://hack.codingblocks.com/app/practice/3/1039/problem
I was trying this problem on hackerblocks.
I have used prime sieve and that too only once.
Also I am implementing my queries in O(1)time.
But still it gives run time error in third case.
Please tell what’s wrong in my code
My code:https://ide.codingblocks.com/s/366012
also if I increase the size of my array then none of the cases pass. All three test cases then show run time error