还是位运算牛
class Solution:
def isPowerOfFour(self, n: int) -> bool:
if n<1:
return False
return (n&(n-1)==0 and (n%3)==1)
还是位运算牛
class Solution:
def isPowerOfFour(self, n: int) -> bool:
if n<1:
return False
return (n&(n-1)==0 and (n%3)==1)