HackerEarth Finding the nth Prime