#K13826. Counting Palindromic Numbers in an Interval
Counting Palindromic Numbers in an Interval
Counting Palindromic Numbers in an Interval
Problem Statement:
Given two integers (a) and (b) representing an interval ([a, b]) (inclusive), determine the number of palindromic numbers within that interval. A number is considered palindromic if it reads the same forward and backward. For example, (121) is a palindromic number because (121 = 121) when reversed, whereas (123) is not. Your task is to print the count of such numbers in the given range.
inputFormat
The input is given via standard input (stdin). It consists of a single line containing two space-separated integers (a) and (b) where (a \leq b).
outputFormat
Output a single integer to standard output (stdout) which represents the number of palindromic numbers in the interval ([a, b]) (inclusive).## sample
1 100
18