n. Return True if n equals 2ᵏ for some integer k ≥ 0, and False otherwise.
Try to solve it without loops or recursion.n=32 → True
32 = 2⁵.
n=1 → True
1 = 2⁰.
n=12 → False
12 = 4 · 3, and the factor 3 spoils it.
n=32
True
Run checks the first 3 tests in your browser. Submit checks all 96 tests on the server, hidden ones included.