No Repeated Neighbour Digit
Count integers in [L, R] with no two adjacent equal digits.
Input: one line with two integers L and R.
Output: the count in [L, R].
Constraints:
- 1 ≤ L ≤ R ≤ 1018
Sample Tests
Input 1
1 25
Output 1
23
Input 2
100 130
Output 2
19
Discussion (opens after you solve — no spoilers before)
No comments yet.