"""
Exercise 1: Power of Two (LeetCode 231)

Return True if n is a power of two, without loops: a power of two has
exactly one set bit, so n > 0 and n & (n - 1) == 0.
"""

def is_power_of_two(n):
    # TODO
    return False


# --- self-check: do not modify below this line ---
cases = [(1, True), (16, True), (3, False), (0, False), (-16, False), (2 ** 40, True)]
ok = all(is_power_of_two(n) == want for n, want in cases)
print([is_power_of_two(n) for n, _ in cases])
print("PASS" if ok else "FAIL")
