Untitled
unknown
plain_text
3 years ago
278 B
12
Indexable
public static int findMinPow(int n){
for(int i=2;;i++){
int j = (int) Math.sqrt(i*i-n);
if(i*i-j*j==n){
return i;
}
if(i*i>Math.pow(10,9)){
return -1;
}
}
}Editor is loading...