2311 [Leet Code] 231. Power of Two, C++ Solution - Use Bitwise operator class Solution { public: bool isPowerOfTwo(int n) { if (n < 0) { return false; } else { return n && !(n & n - 1); } } }; 2023. 1. 17. 이전 1 다음