Bootstrap

C++ | Leetcode C++题解之第231题2的幂

题目:

题解:

class Solution {
private:
    static constexpr int BIG = 1 << 30;

public:
    bool isPowerOfTwo(int n) {
        return n > 0 && BIG % n == 0;
    }
};
;