If a number has a prime factor whose count is 1 then it cannot form the result


#1

public class Solution {
public int isPower(int A) {
if(A==1)
return 1;
int c=0,t=A;
while(A%2==0){
c++;
A/=2;
}
if(t%2==0&&c<2)
return 0;
for(int i=2;i<=Math.sqrt(A);i+=2){
if(A%i==0){
c=0;
while(A%i==0){
c++;
A/=i;
}
if(c<2)
return 0;
}

    }
    if(A>2)
        return 0;
    return 1;
}

}