231. Power of Two 發表於 2023-02-13 | 分類於 leetcode problemsolution1234567class Solution {public: bool isPowerOfTwo(int n) { if(n<=0) return false; return (n&(n-1)) ==0; }}; analysis time complexity O(1) space complexity O(1)