Power of Four
Solution Code
class Solution:
def isPowerOfFour(self, n: int) -> bool:
if n <= 0: return False
while n % 4 == 0:
n //= 4
return n == 1class Solution:
def isPowerOfFour(self, n: int) -> bool:
if n <= 0: return False
while n % 4 == 0:
n //= 4
return n == 1