isPowerOfFour with JavaScript


  • 0
    N
    /**
     * @param {number} num
     * @return {boolean}
     */
    var isPowerOfFour = function(num) {
        return ( Math.log(num) / Math.log(4) ) % 1 === 0;
    };
    

Log in to reply
 

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