693. Binary Number with Alternating Bits
Easy
Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 231 - 1
解題
Last updated