Prime visits on hackerblocks

https://ide.codingblocks.com/s/187728 please look at it and tell why hackerblocks is not accepting it

hi @sgdon142,
while printing the answer use c_sum[a-1] only when a!=0 as if a==0, c_sum[-1] will give garbage value.
so do like;
if(a!=0){
a–;
}
cout<<c_sum[b]-c_sum[a]<<endl;
Rest of ur code is fine
Hope dis resolve ur doubt.

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.