Created
August 6, 2020 05:14
-
-
Save munguial/597a555998caf5d19b0e260819f9e660 to your computer and use it in GitHub Desktop.
August - Day 4 - Power of Four
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def isPowerOfFour(self, num: int) -> bool: | |
i = 0 | |
for i in range(32): | |
if (1 << i) & num and (1 << i) == num and i % 2 == 0: | |
return True | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment