I am getting Time Limit Exceeded - Last executed input:

999983

Does any one know what is wrong with my code?

```
public class Solution {
public int countPrimes(int n) {
int count = 0;
if(n <= 2){
return 0;
}
boolean isPrime;
for(int i=2; i < n; i++){
isPrime = true;
for(int j=2; j <= i/j; j++){
if(i % j == 0 && i != j){
isPrime = false;
break;
}
}
if(isPrime){
count++;
}
}
return count;
}
}
```

Thanks!