Ninja has given a range represented by two positive integers ‘L’ and ‘R’. Find the count of numbers in the range where the first digit is equal to the last digit of the number.
Ninja called you for help as you are his only friend. Help him to solve the problem.
Input: 'L' = 9 , ‘R’ = 12
As ‘9’ and ‘11’ are the only numbers that have their first digit equal to the last digit. So the answer is ‘2’.
Input Format :
The first line will contain the integer 'T', denoting the number of test cases.
Each test case contains two space-separated integers ‘L’ and ‘R’.
Output format :
For each test case, print the number of integers in [L, R] such that their first digit is equal to the last digit in those integers.
You don't need to print anything. It has already been taken care of. Just implement the given function.
1 <= 'T' <= 1000
1 <= ‘L’ <= ‘R’ <= 10^18
Time Limit: 1 sec