# Easy
class Solution: def isPowerOfTwo(self, n: int) -> bool: tmp = 1 while tmp <= n: if tmp == n: return True tmp *= 2 return False
Last updated 4 years ago
Was this helpful?