Skip to content

Instantly share code, notes, and snippets.

@munguial
Created August 6, 2020 05:14
Show Gist options
  • Save munguial/597a555998caf5d19b0e260819f9e660 to your computer and use it in GitHub Desktop.
Save munguial/597a555998caf5d19b0e260819f9e660 to your computer and use it in GitHub Desktop.
August - Day 4 - Power of Four
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