isPowerOfTwo function

bool isPowerOfTwo(
  1. int n
)

Implementation

bool isPowerOfTwo(int n) => n > 0 && (n & (n - 1)) == 0;