Determine if a number is a power of two using bitwise operations.
Constraints
Example
>>> is_power_of_two(1) True >>> is_power_of_two(16) True >>> is_power_of_two(18) False >>> is_power_of_two(0) False >>> is_power_of_two(-8) False
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints