Prateek loves candy

I don’t know what’s wrong in my code.

hello @Lakshita2002
pls share ur code using cb ide


Hi, sorry forgot to add the link

hello @Lakshita2002

a) u need to print nth prime but u r printing sum of prime upto n which is logically incorrect.

follow this->
use sieve and store all prime numbers upto 10^6 in some array and vector .
and then use that vector to answer each query in O(1)

Ok, I attempted in a hurry, will do it again.

@Lakshita2002
check this code for refrence->