2023-09-20 15:32:58 +0000 UTC
Power of Four
Categories:
Links
Code
class Solution:
def isPowerOfFour(self, n: int) -> bool:
return n and not (n & (n - 1)) and (n & 0x55555555)
class Solution:
def isPowerOfFour(self, n: int) -> bool:
return n and not (n & (n - 1)) and (n & 0x55555555)