Determine whether an integer has no consecutive 1 bits in its binary representation.
Constraints
Example
>>> is_sparse(5) True >>> is_sparse(3) False >>> is_sparse(0) True >>> is_sparse(10) True
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints