class Solution {
public:
bool isPowerOfFour(int n) {
if(n==1){
return true;
}
long p=1;
while(p<n){
int x=1;
p=p*pow(4,x);
if(p==n){ // if 4^2 is 16 is req output then 2 comparisions are only done
// 4 pow 1 and and 4 pow 2 which give result ans 16//
return true;
}
}
return false;
}
};