231 Power of Two
Given an integer, write a function to determine if it is a power of two.
The Idea: A number is a power of 2 if it has a single activated bit. E.g.
Complexity: O(1) time and space
Last updated
Given an integer, write a function to determine if it is a power of two.
The Idea: A number is a power of 2 if it has a single activated bit. E.g.
Complexity: O(1) time and space
Last updated