Prateek loves candy


i know this is not the best solution but what is the error in my code??

make a prime sieve till 1000005 just once and then find the nth prime no

or if u want to make update in ur code
iterate till
1000005
image

after updating, its still not working

@Sakshi_Suman
pleasei suggest go through prime sieve lecture then attempt this code

bcz this code needs a lot of update

No, this code needed one simple updation and i did it and now it is working fine. i will do this by prime sieve… but i wanted to try this way also.

instead of 1000005 , 10000 should be there, but you suggested wrong!!

1 Like

okay @Sakshi_Suman
great u could rectify it
i am sorry that u could not guide u well
but will try my best for the future doubts

no problem :slight_smile: thanks anyway!

1 Like