Given a positive integer n, return true if its binary representation has strictly alternating bits (no two adjacent bits are equal), otherwise false.
Input: A JSON object {"n": <positive integer>}.
Output: Return true if the bits of n alternate, otherwise false.
Input: {"n":5}
Output: true
Explanation: 101 alternates -> true.Input: {"n":7}
Output: false
Explanation: 111 has adjacent equal bits -> false.1 <= n <= 10^15