Ad
Code
Diff
  • def power_of_two( n ):
        return bool(n and not (n&(n-1)))
    • def power_of_two( n ):
    • return n & ( n - 1 ) == 0
    • return bool(n and not (n&(n-1)))