Check Adjacent Bits in a Positive Integer. Return whether the ordinary binary representation of positive n has different values at every pair of adjacent bits.
### Problem
Return whether the ordinary binary representation of positive n has different values at every pair of adjacent bits. Ignore leading zero padding.
```cpp
class Solution {
public:
bool hasAlternatingBits(int n);
};
```
### Examples
**Example 1:**
```text
n = 10
Output: true
Explanation: Binary 1010 alternates.
```
**Example 2:**
```text
n = 12
Output: false
Explanation: Binary 1100 has equal adjacent bits.
```
### Constraints
- The input n is positive and does not exceed 2147483647.
### Clarifying Questions
Ignore leading padding and check all adjacent significant bit pairs.
```hint Read the boundary condition
What information from the previous extracted bit is sufficient for the next check?
```
### Contract considerations
Ignore leading padding and check all adjacent significant bit pairs.
Overview: Check Adjacent Bits in a Positive Integer. Return whether the ordinary binary representation of positive n has different values at every pair of adjacent bits.