The code that I wrote is showing the desired output when I compile but when I submit it shows an error !TLE.
I don’t understand th eproblem.
My code is:
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scn=new Scanner(System.in);
int n=scn.nextInt();
int i,j,p,P,temp=0;
// boolean bool;
for(i=0;i<n;i++) {
p=scn.nextInt();
P=0;
j=2;
while(P!=p) {
int count=0;
for(int k=1;k<=j;k++) {
if(j%k==0) {
count++;
//System.out.println(+count);
//System.out.println(+k);
//System.out.println(+j);
}
}
if(count==2) {
P++;
}
temp=j;
j++;
}
System.out.println(+temp);
}
}
}
