0693. Binary Number with Alternating Bits
Description
**Input:** n = 5
**Output:** true
**Explanation:** The binary representation of 5 is: 101**Input:** n = 7
**Output:** false
**Explanation:** The binary representation of 7 is: 111.**Input:** n = 11
**Output:** false
**Explanation:** The binary representation of 11 is: 1011.**Input:** n = 10
**Output:** true
**Explanation:** The binary representation of 10 is: 1010.ac
Last updated