This is my code. Is there a more optimised way to solve this problem
Deepak and primes
@tanjuljain19 your code will work fine,one more way is that dont store all the prime upto n in array a just keep count of primes ,when this count becomes n just print the current prime and break the loop in this way you don’t need extra memory for array a.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.