bool isPowerOfTwo(int n) { return n > 0 && !(n&(n-1)); }
Input: n = 3 Output: false
bool IsPowerOfTwo(ulong x) { return (x != 0) && ((x & (x - 1)) == 0); }