TTC '18 Contest 2 P3 - Same Numbers

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Reading numbers are hard. Especially when the numbers are able to go up to 10^5.

This time, jsumabat is given 2 integers, P and Q. jsumabat can read a given integer if the number read backwards is the same when the number is read forward.

Can you help jsumabat find out the amount of integers between P and Q that he can read?

Input Specification

The first and only line of input will contain two space-separated integers, P and Q (1 \le P < Q \le 10^5).

Output Specification

You are to output a single integer: the amount of numbers between P and Q that jsumabat can read.

Sample Input 1

90 120

Sample Output 1

3

Sample Explanation

The numbers that jsumabat can read are:

  • 99
  • 101
  • 111

Comments

There are no comments at the moment.