Given a whole number n, check if it is a power of two.
A number is a power of two when it equals 2 multiplied by itself some number of times (zero times is allowed, so 1 counts). So 1, 2, 4, 8 and 16 are powers of two.
Answer true when n is a power of two, and false when it is not.
Examples
Example 1:
Input: n = 64
Output: true
Explanation: 64 = 2 x 2 x 2 x 2 x 2 x 2.
Example 2:
Input: n = 12
Output: false
Explanation: 12 lies between 8 and 16, so it is not a power of two.
Example 3:
Input: n = -8
Output: false
Explanation: A negative number is never a power of two.