Given an integer, write a function to determine if it is a power of two.
Example
No.1
Input: 1
Output: true
Explanation: 2^0 = 1
No.2
Input: 16
Output: true
Explanation: 2^4 = 16
No.3
Input: 218
Output: false
Code
1 | public boolean isPowerOfTwo(int n) { |