Adjacent Digits Differ by One
Count integers in [L, R] where every pair of adjacent digits differs by exactly 1 (like 1232).
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 30
Output 1
0
Input 2
10 90
Output 2
0
Discussion (opens after you solve — no spoilers before)
No comments yet.