Prateek loves Candy (Number Theory)

Didn’t understand the question’s logic , please help me to explain with example…

In input ==> an integer n is given
and we have to find the nth prime number
for example:
n=5;
primenumbers are: [2,3,5,7,11,13,…] ==> 5th prime number is 11 so ans=11;

n=1 ==> 1st prime number is 2 so ans = 2;

n=3 ==> 3rd prime number is 5 so ans = 5;

Hint :bulb: : you can use primesieve approach to make the array of all prime numbers and then find the ith prime number from the array of prime no.s.

Reference Code:

If You have further doubt feel free to ask