2025-08-09 11:14:40 +0300 MSK

Power of Two

Code

class Solution:
    def isPowerOfTwo(self, n: int) -> bool:
        return n > 0 and (n & (n - 1)) == 0