First Digit Equals Last
Count integers in [L, R] whose first and last decimal digits are equal.
Input: one line with two integers L and R.
Output: the count in [L, R].
Constraints:
- 1 ≤ L ≤ R ≤ 106
Sample Tests
Input 1
1 100
Output 1
18
Input 2
11 99
Output 2
9
Discussion (opens after you solve — no spoilers before)
No comments yet.