Can you check my code it is not running any of the test cases
Your mistakes
-
at line no 20
you are inserting 2 in prime vector twice
run the for loop from 3 because you have already pushed 2 into vector -
in main() don’t run the loop to print ans
just print primes[n-1]; -
p should be bool array not of the type ll
because it holds 0 or 1
check out all the corrections in below code
Modified code