Bit Manipulation - Power of Two
Identify the bug in the following code that attempts to check if a number is a power of two:
def isPowerOfTwo(n: int) -> bool:
while n % 2 == 0:
n //= 2
return n == 1
What is the issue?