Palindromic Numbers
Practice
3.4 (61 votes)
Ad Hoc
Algorithms
Approved
Basic programming
Easy
Open
Problem
75% Success 15784 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code
Given A and B, count the numbers N such that A ≤ N ≤ B and N is a palindrome.
Examples:
Palindromes: 121, 11 , 11411
Not Palindromes: 122, 10
Input:
First line contains T, the number of testcases. Each testcase consists of two integers A and B in one line.
Output:
For each testcase, print the required answer in one line.
Constraints:
1 ≤ T ≤ 10
0 ≤ A ≤ B ≤ 105
Code Editor
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Submissions
Please login to view your submissions
Similar Problems
Points:20
16 votes
Tags:
ApprovedBasic ProgrammingEasy
Points:20
58 votes
Tags:
ArraysEasyMath
Points:20
16 votes
Tags:
ApprovedBasic ProgrammingEasyImplementationOpen
Editorial
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor