'''
Power of Four
Given an integer (signed 32 bits), write a function to check whether it is a power of 4.

Personal challenge:
Implement the solution without loop and recursion

Ex)
Input: 16
Output: true

'''

from math import log

class Solution:
    def isPowerOfFour(self, num: int) -> bool:
        if num <= 0:
            return False
        num = log(num,4)
        return num - int(num) == 0


8a18385fec479f5ec21b10186528c730919ed941
<mask token>

<mask token>


class Solution:
    <mask token>

<mask token>


class Solution:

    def isPowerOfFour(self, num: int) ->bool:
        if num <= 0:
            return False
        num = log(num, 4)
        return num - int(num) == 0

<mask token>
from math import log


class Solution:

    def isPowerOfFour(self, num: int) ->bool:
        if num <= 0:
            return False
        num = log(num, 4)
        return num - int(num) == 0

'''
Power of Four
Given an integer (signed 32 bits), write a function to check whether it is a power of 4.

Personal challenge:
Implement the solution without loop and recursion

Ex)
Input: 16
Output: true

'''

from math import log

class Solution:
    def isPowerOfFour(self, num: int) -> bool:
        if num <= 0:
            return False
        num = log(num,4)
        return num - int(num) == 0

