Share java solution


  • 0
    M
    public boolean isPowerOfFour(int num) {
        while(num>1){
            if((num & 11) != 0) return false;
            num>>=2;
        }   
        return num==1;
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.