位運算

231. 2 的冪

```
class Solution {
public boolean isPowerOfTwo(int n) {
int cnt = 0;

    while (n>0) {
if ((n & 1) == 1) cnt++;
n >>= 1;
} return cnt == 1;
}

}