Easy C++ Solution


  • 0
    B
    bool isPowerOfFour(int num) {
            if(num == 0)return false;
        
        while(num%4 == 0 && num > 1){
            num = num/4;
        }
        return num == 1;
        }

Log in to reply
 

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