I am getting all correct except last two can you please tell me the error or the problem with my code;
Getting wrong answer for last two test cases
Hi
@archit1jain please ask doubt through ask doubt in your online course, i’m not able to view this doubt in my portal, i’ll be able to help you. i hope you understand it.
Thanks!
wrong test case
n=5000000
correct output =86028121
you output=86522069
In Java , you will always face problems with int to long conversions.
For this , in your code j=i*i is creating problem as it overflows int range.
just use in line 18
for(int j = i ; j<sieve.length ;j=j+i)
your code will work fine
I by mistake Acknowledged and not replied here. His account is approved from portal.Its a mistake from my end.
Ohh okay Anubhav Aron!
No issue 
Than You so much, it is working fine now.
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.
I posted the doubts for other questions too, but they haven’t been resolved yet. Its been almost two days.