231. Power of Two
https://leetcode.com/problems/power-of-two
Python
class Solution:
def isPowerOfTwo(self, n: int) -> bool:
while n > 1:
n /= 2
return n == 1
https://leetcode.com/problems/power-of-two
class Solution:
def isPowerOfTwo(self, n: int) -> bool:
while n > 1:
n /= 2
return n == 1