Java 2 line Solution


  • 0
    S
    public boolean isPowerOfFour(int num) {
            long l = Integer.toUnsignedLong(num);
            return ((Math.log10(l)/Math.log10(4)) % 1) == 0;
    }
    

Log in to reply
 

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