【LeetCode 231_整數_位運算】Power of Two

QingLiXueShi發表於2015-07-06

1 bool isPowerOfTwo(int n)
2 {
3     return n > 0 && !(n & (n - 1));
4 }

相關文章