#C6885. Count Palindrome Numbers in Ranges
Count Palindrome Numbers in Ranges
Count Palindrome Numbers in Ranges
This problem requires you to count the number of palindrome numbers within given ranges. A palindrome number is one that remains the same when its digits are reversed. Formally, a number \( n \) is a palindrome if it satisfies \( n = \text{rev}(n) \), where \( \text{rev}(n) \) denotes the digits of \( n \) written in reverse order.
You are given an integer \( T \) denoting the number of test cases. For each test case, you are provided with two integers \( L \) and \( R \), representing the range [\( L, R \)]. Your task is to count how many integers within each range are palindromic.
Example:
For the range [1, 10], the palindromic numbers are: 1, 2, 3, 4, 5, 6, 7, 8, 9 (all single-digit numbers) resulting in a count of 9.
inputFormat
The first line contains an integer \( T \), the number of test cases. Each of the following \( T \) lines contains two space-separated integers \( L \) and \( R \) (\( L \le R \)), representing the endpoints of a range.
Input is provided via standard input (stdin).
outputFormat
For each test case, output a single integer on a new line representing the count of palindrome numbers in the inclusive range [\( L, R \)]. The output should be printed to standard output (stdout).
## sample2
1 10
100 200
9
10
</p>