Given an integer n, return true if it is a power of two.
Otherwise, return false.
An integer is a power of two if there exists an integer x such that
n == 2x.
nInput: 1 Output: true
Input: 16 Output: true
Input: 3 Output: false
Your program must print true or false
so it can be compared with the expected output.
No submissions yet.
Discuss bit manipulation, logarithmic checks, and edge cases like zero or negatives.