Problem:
 Score : 200 points    Problem Statement Find the number of palindromic numbers among the integers between A and B (inclusive).
Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.      Constraints  10000 \leq A \leq B \leq 99999  All input values are integers.         Input Input is given from Standard Input in the following format:  A  B       Output Print the number of palindromic numbers among the integers between A and B (inclusive).        Sample Input 1 11009 11332      Sample Output 1 4  There are four integers that satisfy the conditions: 11011 , 11111 , 11211 and 11311 .       Sample Input 2 31415 92653      Sample Output 2 612

Solution (Python):
import sys
input = sys.stdin.readline
a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):
    x=str(i)
    flg=True
    for j in range(len(x)):
        if x[j]!=x[-j-1]:
            flg=False
    if flg:cnt+=1
print(cnt)

Solution (Python):
import sys
input = sys.stdin.readline
A, B = [int(x) for x in input().split()]
import numpy as np
a = np.arange(A, B + 1)
a = np.array(a, np.object)
ans = 0
for i in a:
    i = str(i)
    if i[0] == i[4] and i[1] == i[3]:
        ans += 1
print(ans)

Solution (Python):
a,b  = map(int, input().split())

cnt = 0
for i in range(a,b+1):
    s = str(i)
    if s[0] == s[-1] and s[1] == s[-2]:
        cnt += 1
print(cnt)

Solution (Python):
a, b = map(int, input().split())
cnt = 0
for i in range(a, b+1):
  s = str(i)
  if s == s[::-1]:
    cnt+=1
print(cnt)

Solution (Python):
a, b = map(int, input().split())
cnt = 0
for i in range(a, b + 1):
    if str(i)  == str(i)[::-1]:
        cnt += 1

print(cnt)

Solution (Python):


a, b = map(int, input().split())

count = 0
for i in range(a, b+1):
    str_n = str(i)
    if str_n[:] == str_n[::-1]:
        count += 1
print(count)

Solution (Python):
a,b = map(int,input().split())
count = 0
for i in range(a,b+1):
    if str(i) == str(i)[::-1]:
        count += 1
print(count)

Solution (Python):

 
import math
import itertools
import sys
import copy
 




A, B = map(int, input().split())

cnt = 0
for i in range(A, B+1) :
  s = str(i)
  if s[0] == s[4] and s[1] == s[3] :
    cnt += 1

print (cnt)

Solution (Python):
def is_palindrome(s):
    for i in range(len(s) // 2 + 1):
        if s[i] != s[-i-1]:
            return False
    return True


a,b = map(int, input().split())

ans = 0
for i in range(a,b+1):
  if is_palindrome(str(i)):
  	ans += 1
print(ans)

Solution (Python):
A,B = map(int,input().split())
print([str(x) == str(x)[::-1] for x in range(A,B+1)].count(True))

Solution (Python):
a = list(map(int, input().split()))
ans = 0
for i in range(a[0], a[1]+1):
    t = str(i)
    flag = True
    for j in range(len(t)//2):
        if t[j]!=t[len(t)-1-j]:
            flag = False
    ans += 1 if flag else 0
print(ans)

Solution (Python):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    for j in range(len(str(i))//2+1):
        
        if str(i)[j] != str(i)[-j-1]:
            break
        if j == len(str(i))//2:
            ans += 1


print(ans)

Solution (Python):
a,b=map(int,input().split())
print(sum(i==i[::-1] for i in map(str,range(a,b+1))))

Solution (Python):
A, B = map(int, input().split())


def f(n):
    result = 0
    for i in range(10000, n + 1):
        t = str(i)
        if t == t[::-1]:
            result += 1
    return result


print(f(B) - f(A - 1))

Solution (Python):
a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):  
  ii=str(i)
  if ii[-1]!="0":
    flg=True
    for i in range(2):
      if ii[i] != ii[-i-1]:
        flg=False
    if flg:
      cnt+=1
print(cnt)

Solution (Python):

a,b=input().split()
num=[str(i) for i in range(int(a),int(b)+1)]
ans=0
for x in num:
    flag=True
    for i in range(int(len(x)/2)):
        if x[i]!=x[-1*i-1]:
            flag=False
            break
    if flag:
        ans+=1
print(ans)

Solution (Python):
a,b = map(int,input().split())
ans = 0

for i in range(a,b+1):
    c = str(i)
    if c[0] == c[4] and c[1] == c[3]:
        ans += 1
    
print(ans)

Solution (Python):
a,b=map(int,input().split())

cnt=0
for i in map(str,range(a,b+1)):
    if i==i[::-1]:
        cnt += 1
print(cnt)

Solution (Python):
a, b = map(int, input().split())
k = b-a
cnt = 0

for i in range(k+1):
  if str(a+i)[0]==str(a+i)[-1] and str(a+i)[1]==str(a+i)[-2]:
        cnt += 1

print(cnt)

Solution (Python):
A, B = map(int, input().split())
cnt = 0
for i in range(A, B+1):
    j = list(str(i))
    if j[0] == j[4] and j[1] == j[3]:
        cnt += 1
print(cnt)

Solution (Python):
a, b = (int(i) for i in input().split())  
c = 0
for i in range(a,b + 1):
    if str(i) == str(i)[::-1]:
        c = c + 1
print(c)

Solution (Python):
A,B=map(int,input().split())
cnt=0
for i in range(A,B+1):
  j=list(str(i))
  if j[0]==j[4] and j[1]==j[3]:
    cnt+=1
print(cnt)

Solution (Python):
A,B = map(int, input().split())
count = 0
for a in range(A,B+1,1):
    s = str(a)
    flg = 1
    for i in range(len(s)//2):
        if s[i]==s[-(i+1)]:
            continue
        else:
            flg = 0
            break
    if flg==1:
        count = count + 1
print(count)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    x=str(i)
    if x[0]==x[4] and x[1]==x[3]:
        ans+=1
print(ans)

Solution (Python):
import sys
from bisect import bisect_left as bi_l, bisect_right as bi_r

a, b = map(int, sys.stdin.readline().split())

def main():
    palindromic_nums = []
    for i in range(1, 10):
        for j in range(10):
            for k in range(10):
                x = [i, j, k, j, i]
                palindromic_nums.append(int(''.join(list(map(str, x)))))

    return bi_r(palindromic_nums, b) - bi_l(palindromic_nums, a)
                
if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
a, b = map(int, input().split())

an = 0
for x in range(a, b + 1):
    x = str(x)
    f = True
    for i in range(len(x)):
        if x[i] != x[len(x) - i - 1]:
            f = False
    if f:
        an += 1
print(an)

Solution (Python):
a,b = map(int, input().split())
answer = 0
for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        answer += 1
    else:
        continue
print(answer)

Solution (Python):


a,b=map(int,input().split())

ans=0
for i in range(a,b+1):
    p=str(i)
    for j in range(3):
        if p[j]!=p[4-j]:
            break
        if j==2:
            ans+=1

print(ans)


"""
11009 11332

4

31415 92653

612
"""

Solution (Python):
a,b=map(int,input().split())
c=0
for s in range(a,b+1):
    flag = 1
    for i in range(len(str(s))//2+1):
        if str(s)[i]!=str(s)[-i-1]:
            flag = 0
            break
    if flag:
        c += 1
print(c)

Solution (Python):
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
  if str(i)==str(i)[::-1]:
    count+=1
print(count)

Solution (Python):
a,b=map(int,input().split())
i=0
for n in range(a,b+1):
    if str(n)==str(n)[::-1]:
        i+=1
print(i)

Solution (Python):
A, B = map(int, input().split())

ans = 0

for i in range(A,B+1):
    STRI = str(i)
    if STRI == STRI[::-1]:
        ans = ans + 1

print(ans)

Solution (Python):
import sys
a, b = map(int, sys.stdin.readline().split())

count = 0
for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        count += 1
print(count)

Solution (Python):
a, b = map(int, input().split())

ans = 0
for num in range(a, b+1):
    s = str(num)
    if s[0] == s[4] and s[1] == s[3]:
        ans += 1

print(ans)

Solution (Python):
a,b = map(int,input().split())

count = 0
for i in range(a,b+1):
  z = list(str(i))
  z = int("".join(z[::-1]))
  if z == i:
    count += 1
    
print(count)

Solution (Python):
i = list(map(int, input().split()))
cnt=0
for i in range(i[0],i[1]+1):
	j = str(i)[::-1]
	if(str(i) == j):
		cnt+=1
print(cnt)

Solution (Python):
A, B = list(map(int, input().split()))
res = 0


def is_palindoromic(num):
    tmp = str(num)
    n_len = len(tmp) // 2
    length = len(tmp)
    for i in range(n_len):
        if tmp[i] != tmp[length - i - 1]:
            return False
    return True


for i in range(A, B + 1):
    if is_palindoromic(i):
        res += 1

print(res)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
  if str(i)[0]==str(i)[4] and str(i)[1]==str(i)[3]:
    ans+=1
print(ans)

Solution (Python):
A, B = map(int, input().split())

count = 0
for x in range(A, B+1):
    s = str(x)
    l = len(s) // 2
    if s[:l+1] == s[::-1][:l+1]:
        count += 1
print(count)

Solution (Python):
def is_palindromic_number(num):
    num_s = list(str(num))
    while len(num_s) > 1:
        if num_s.pop(0) != num_s.pop():
            return False
        
    return True

A,B = map(int, input().split())
print(sum(is_palindromic_number(num) for num in range(A,B+1)))

Solution (Python):
A,B = map(int, input().split())
count = 0

for s in range(A,B+1):
    if str(s) == str(s)[::-1]:
        count += 1
print(count)

Solution (Python):
A, B = [int(i) for i in input().split()]

count = 0 
for i in range(A, B+1):
    c = list(str(i))
    if c[0] == c[4] and c[1] == c[3]:
        count += 1

print(count)

Solution (Python):
A,B = map(int,input().split())
print(sum([1 for i in map(str,range(A,B+1)) if i == i[::-1]]))

Solution (Python):
A, B = [int(c) for c in input().split()]

count = 0

for i in range(A, B+1):
    str_i = str(i)

    if str_i == str_i[::-1]:
        count += 1

print(count)

Solution (Python):
a,b = map(int, input().split())
l = range(a, b+1)

def digitSum(n):
    
    s = str(n)
    
    array = list(map(int, s))
    
    return array

ans = 0
for i in range(a, b+1):
	s = digitSum(i)
	if s[0]==s[-1] and s[1] == s[-2]:
		ans += 1
print(ans)

Solution (Python):
a,b=map(int, input().split())
c=0
for i in range(a,b+1):
  if str(i)==str(i)[::-1]:
    c+=1
print(c)

Solution (Python):
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
    s=str(i)
    if s[0]==s[-1] and s[1]==s[-2]:
        c+=1

print(c)

Solution (Python):
a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):
  if str(i) == str(i)[::-1]:
    cnt+=1
print(cnt)

Solution (Python):
a,b=map(int,input().split())
count=0

for i in range(a,b+1):
  num=[j for j in str(i)]
  if num[0]==num[4] and num[1]==num[3]:
    count+=1

print(count)

Solution (Python):
line = input().split()
a = int(line[0])
b = int(line[1])
count = 0
for i in range(a,b+1):
  num = str(i)
  if num[0] == num[4] and num[1] == num[3]:
    count += 1
print(count)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(a, b + 1):
    num = str(i)
    n = len(num)
    for j in range(n // 2):
        if num[j] != num[n - 1 - j]:
            break
        elif j == n // 2 - 1:
            ans += 1
print(ans)

Solution (Python):
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
    if str(i) == str(i)[::-1]:
        ans += 1
print(ans)

Solution (Python):
a,b = map(int, input().split())
c = 0
for i in range(a,b+1):
    i = str(i)
    for j in range(2):
        if i[j] != i[-(j+1)]:
            break
    else:
        c+=1
print(c)

Solution (Python):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
  s = list(str(i))
  left = s[0:2]
  right = s[3:]
  right.reverse()
  if left == right:
    ans += 1
print(ans)

Solution (Python):
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
    s=str(i)
    ss=s[::-1]
    if s==ss:
        count+=1
print(count)

Solution (Python):
[print(sum(str(num)[0:2] == str(num)[5:2:-1] for num in range(a, b + 1))) for a, b in [map(int, input().split())]]

Solution (Python):
A, B = map(int, input().split())
cnt = 0
for i in range(A, B+1):
  x = str(i)
  if x[0] == x[4] and x[1] == x[3]:
    cnt += 1
print(cnt)

Solution (Python):
a, b = map(int, input().split())
cnt = 0
for i in range(a,b+1):
	s = str(i)
	d = s[::-1]
	if s == d:
		cnt += 1
print (cnt)

Solution (Python):
a,b = map(int, input().split())
n = 0
for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            s = 10000 * i + 1000 * j + 100 * k + 10 * j + i
            if a <= s <= b:
                n += 1
print(n)

Solution (Python):
a,b = map(int, input().split())
n = 0
for i in range(a, b + 1):
    f = True
    s = str(i)
    l = len(s)
    for j in range(l//2 + 1):
        if s[j] != s[- j - 1]:
            f = False
            break
    if f:
        n += 1
print(n)

Solution (Python):
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
    s = str(i)
    if(len(s) == 1):
        count += 1
        break
    for j in range(len(s) // 2):
        if(s[j] != s[len(s)-1-j]):
            break
    else:
        count += 1
print(count)

Solution (Python):
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
    s = str(i)
    if(len(s) == 1):
        count += 1
        break
    for j in range(len(s) // 2):
        if(s[j] != s[len(s)-1-j]):
            break
    else:
        count += 1
print(count)

Solution (Python):
a, b = map(int, input().split())

cnt = 0

for i in range(a, b + 1):
    ls_i = list(str(i))
    if ls_i == list(reversed(ls_i)):
        cnt += 1

print(cnt)

Solution (Python):
A, B = map(int, input().split())
c = 0
for i in map(str, range(A, B + 1)):
    if i == i[::-1]:
        c += 1
print(c)

Solution (Python):
A, B = map(int, input().split())

total = 0

for i in range(A, B + 1):
    str_i = str(i)
    length = len(str_i)
    half = length // 2
    rev = str_i[::-1]
    if str_i[:half] == rev[:half]:
        total += 1

print(total)

Solution (Python):
a, b = map(int, input().split())

ans = 0
for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        ans += 1
print(ans)

Solution (Python):
a,b = map(int, input().split())

count = 0

for i in range(a,b+1):
    x,y,g,h,z = str(i)
    if x == z and y == h:
        count += 1

print(count)

Solution (Python):
A,B=[int(s) for s in input().split()]
a=A//100
b=B//100
def pal(num):
  return num*101-num%10-(num//100)*99
ans=b-a-1
if pal(a)>=A:
  ans+=1
if pal(b)<=B:
  ans+=1
print(ans)

Solution (Python):
def palindromeQ(num):
  if num%10==num//10000:
    if (num%100)//10==(num//1000)%10:
      return(1)
    else:
      return(0)
  else:
    return(0)
ans=0
A,B=[int(s) for s in input().split()]
for i in range(A,B+1):
  ans+=palindromeQ(i)
print(ans)

Solution (Python):
A , B = map(int,input().split())
cnt = 0
for i in range(A , B + 1):
    check = list(str(i))
    if check == check[::-1]:
        cnt += 1
print(cnt)

Solution (Python):
AB=list(map(int,input().split()))
A=AB[0]
B=AB[1]
cnt=0

for i in range(A,B+1):
    i=list(str(i))
    j=list(reversed(i))
    if i==j:
        cnt=cnt+1

print(cnt)

Solution (Python):
a, b = map(int, input().split())
cnt = 0
for i in range(a, b+1):
    i = str(i)
    if i[0] == i[4] and i[1] == i[3]:
        cnt += 1
print(cnt)

Solution (Python):
A, B = map(int,input().split())

ans = 0
for n in range(A, B+1):
    n = str(n)
    if n == n[::-1]:
        ans += 1
print(ans)

Solution (Python):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    x = [j for j in str(i)]
    y = list(x) 
    x.reverse()
    if x == y:
        ans += 1
print(ans)

Solution (Python):
a, b = map(int, input().split())
no_count = 0 
if int(str(a // 1000)[::-1]) < a % 100:
        no_count -= 1
if int(str(b // 1000)[::-1]) > b % 100:
        no_count -= 1
print(b // 100 - a // 100 + 1 + no_count)

Solution (Python):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    if str(i) == str(i)[::-1]:
        ans += 1
print(ans)

Solution (Python):

A,B = map(int,input().split())
ans = []

for i in range(A,B+1):
    l = str(i)

    if l == l[::-1] :
        ans.append(i)

print(len(ans))

Solution (Python):
a,b = [int(i) for i in input().split()]
ct = 0
for i in range(a,b+1):
    L = str(i)
    if L == L[::-1]:
        ct += 1
        
print(ct)

Solution (Python):
a,b = map(int,input().split())
c = 0
for i in range(a,b+1):
    s = str(i)
    if s == s[::-1]:
        c+=1
print(c)

Solution (Python):

A,B = map(int, input().split())
ans = 0
for i in range(A,B+1):
    text = str(i)
    if text ==text[::-1]:
        ans += 1
print(ans)

Solution (Python):


A,B=list(map(int,input().split(" ")))
c=0 

for n in range(A,B+1):
    ns=list(str(n)) 
    nsr=list(reversed(ns)) 

    if ns==nsr: 
        c+=1 

print(c)

Solution (Python):
a,b =map(int,input().split())
print(sum(i==i[::-1] for i in map(str,range(a,b+1))))

Solution (Python):
A, B = map(int, input().split())

count = 0
for i in range(A, B+1):
    str_i = str(i)
    if str_i[0] == str_i[4] and str_i[1] == str_i[3]:
        count += 1
        
print(count)

Solution (Python):

import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

a,b=map(int,input().split())
for i in range(a,b+1):
    if str(i)==str(i)[::-1]:
        count+=1
print(count)

Solution (Python):
a, b = map(int, input().split())
ans = []
for i in range(b-a+1):
    num = list(map(str, str(a + i)))
    if num[0] == num[4] and num[1] == num[3]:
        ans.append(int("".join(num)))
print(len(ans))

Solution (Python):
a,b = map(int,input().split())

ans = 0
for i in range(a,b+1):
    if list(str(i)) == list(str(i))[::-1]:
        ans += 1

print(ans)

Solution (Python):
a, b = map(int, input().split())
count = 0
for i in range(a, b + 1):
    if str(i)[0] == str(i)[-1] and str(i)[1] == str(i)[-2]:
        count +=1

print(count)

Solution (Python):
A,B=map(int,input().split())
count=0
for i in range(A,B+1):
  S=str(i)
  if S[0]==S[4] and S[1]==S[3]:
    count+=1
print(count)

Solution (Python):
def examB():
    A, B = LI()
    ans = 0
    for i in range(A,B+1):
        cur = str(i)
        if cur==cur[::-1]:
            ans +=1
    print(ans)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Solution (Python):
A, B = list(map(int, input().split()))
ans = 0
for i in range(A,B+1):
    if i==int(str(i)[::-1]):ans +=1
print(ans)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(a,b+1):
    b = str(i)
    if b[::-1] == b:
        ans += 1
    else:
        pass
print(ans)

Solution (Python):
a,b = map(int,input().split())

ans = 0

for i in range(a,b+1):
	
	
	s = str(i)
	k = len(s)
	s1 = s[:k//2]
	s2 = s[k//2+1:]
	s3 = s2[::-1]
	
	
	
	if s1==s3:
		ans = ans + 1

print(ans)

Solution (Python):
A = list(map(int,input().split()))
count = 0
for i in range(A[0],A[1]+1):
  a = str(i)
  if a[0] == a[4] and a[1] == a[3]:
    count += 1
print(count)

Solution (Python):
a, b = map(int, input().split())
count = 0
for x in range(1,10) :
    for y in range(0,10) :
        for z in range(0, 10) :
            if (a <= (10001 * x + 1010 * y + 100 * z)) and ((10001 * x + 1010 * y + 100 * z) <= b) :
                count += 1
print(count)

Solution (Python):
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
  if str(i)==str(i)[::-1]:
    count+=1
print(count)

Solution (Python):
from sys import stdin
import numpy as np
import math

a,b = [int(x) for x in stdin.readline().rstrip().split()]
point = 0
for i in range(a,b+1):
    if str(i)[:2] == str(i)[3:][::-1]:
        point += 1

print(point)

Solution (Python):
A, B = map(int, input().split())
count = 0
for num in range(A, B+1):
    num = str(num)
    search_range = len(num)//2+len(num)%2
    for num_i in range(search_range):

        if num[num_i] != num[(-1)*num_i - 1]:
            break
        if num_i == search_range -1:
            count += 1
print(count)

Solution (Python):
A,B=map(int,input().split())
import copy
M=0
for i in range(A,B+1):
    a=list(str(i))
    b=copy.deepcopy(a)
    b.reverse()
    if a==b:
        M+=1
print(M)

Solution (Python):
A,B = map(int,input().split())
ans = 0
for i in range(A,B+1):
    S = str(i)
    if(S[0] == S[4] and S[1] == S[3]):
        ans += 1
print(ans)

Solution (Python):
a, b = list(map(int, input().split()))

ans = 0
for num in range(a, b+1):
    s = str(num)
    rev_s = ""
    for i in reversed(range(len(s))):
        rev_s += s[i]
    if s == rev_s:
        ans += 1
print(ans)

Solution (Python):
def main():
  A, B = map(lambda i: int(i), input().split(' '))
  count = 0
  for i in range(A, B + 1):
    nums = list(str(i))
    if nums[0] == nums[4] and nums[1] == nums[3]:
      count += 1
  print(count)

main()

Solution (Python):

a, b = [int(s) for s in input().split()]
number_of_parindromics = 0

for i in range(a, b + 1):
    if str(i) == str(i)[::-1]:
        number_of_parindromics += 1

print(number_of_parindromics)

Solution (Python):
A, B = map(int, input().split())
ans = 0

for i in range(A, B + 1):
    n = str(i)
    if n == n[::-1]:
        ans += 1

print(ans)

Solution (Python):
a, b = map(int, input().split())
c = 0
for i in range(a, b+1):
  temp = str(i)
  if temp[0] == temp[-1] and temp[1] == temp[-2]:
    c += 1
print(c)

Solution (Python):
import math
a, b = [int(x) for x in input().split()]
count=0
for i in range(a, b+1):
    s = str(i)
    if s[0]+s[1] == s[4]+s[3]:
        count+=1
print(count)

Solution (Python):
a = list(map(int,input().split()))
i = a[0]
m = 0
while i <= a[1]:
	n1 = i % 10
	n2 = (i % 100) // 10
	n3 = (i % 1000) // 100
	n4 = (i % 10000) // 1000
	n5 = i // 10000
	if n1 == n5 and n2 == n4:
		m += 1
	i += 1
print(m)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def main():
    a,b=map(int,input().split())
    c=0
    for i in range(a,b+1):
        s=str(i)
        if s==s[::-1]:
            c+=1
    print(c)

main()

Solution (Python):
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
  s = str(i).zfill(5)
  if s[0] == s[-1] and s[1] == s[-2]:
    count += 1
print(count)

Solution (Python):
A, B = map(int, input().split())
ans = 0

def check(x):
  tx = list(str(x))
  c = 1
  for i in range(len(tx)):
    if tx[i] != tx[-1 * i -1]:
      c = 0
  return c

for i in range(A, B+1):
  ans += check(i)

print(ans)

Solution (Python):
a,b=map(int,input().split())
l=list(range(a,b+1))
le=0
ans=0
for i in l:
    i=str(i)
    count=0
    for j in range(len(i)//2):
        if i[j]==i[len(i)-1-j]:
            count+=1
            if count==len(i)//2:
                ans+=1
        else:
            count=0
            break
print(ans)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    x=list(str(i))
    for j in range(2):
        if x[j]!=x[len(x)-1-j]:
            break
        else:
            if j==1:
                ans+=1
print(ans)

Solution (Python):
A, B = map(int, input().split())
counter = 0
for num in range(A, B + 1):
    if str(num) == str(num)[::-1]:
        counter += 1

print(counter)

Solution (Python):
number = []
number = input().split()

start_number = int(number[0])
end_number = int(number[1])
count = 0

while start_number <= end_number:
    l = []
    for s in str(start_number):
        l.append(s)
    if l[0] == l[4] and l[1] == l[3]:
        count += 1
    start_number += 1

print(count)

Solution (Python):
a, b = map(int, input().split())
cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            c = 10000*i+1000*j+100*k+10*j+i
            if a <= c <= b:
                cnt += 1

print(cnt)

Solution (Python):
a, b = map(int, input().split())
cnt = 0

for i in range(a, b+1):
    i = str(i)
    if i[0] == i[-1] and i[1] == i[-2]:
        cnt += 1

print(cnt)

Solution (Python):
a,b = map(int ,input().split())
ans=0
for i in range (a,b+1):
    l=list(str(i))
    if l[0]==l[4] and l[1]==l[3]:
        ans+=1
print(ans)

Solution (Python):
A,B = map(int,input().split())
B+=1
ans=0
for i in range(A,B):
    s=str(i)
    if s==s[::-1]:ans+=1
print(ans)

Solution (Python):
A,B=map(int,input().split())
count=0
for i in range(A,B+1):
        if str(i)==str(i)[::-1]:
            count+=1
print(count)

Solution (Python):
a,b = map(int, input().split())
ans = 0
for i in range(a, b+1):
    if i == int(str(i)[::-1]):
        ans += 1
print(ans)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a,b = inpl()
res = 0
for i in range(a,b+1):
    tmp = str(i)
    if tmp[0] == tmp[-1] and tmp[1] == tmp[-2]:
        res += 1
print(res)

Solution (Python):
a,b=map(int,input().split())
count =0
for i in range(a,b+1):
    if str(i) == str(i)[::-1]:
        count+=1
print(count)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
int1 = lambda x: int(x) - 1

def main():
    def cnt(x):
        res = 0
        for i in range(9999, x + 1):
            s = str(i)
            for c0, c1 in zip(s, s[::-1]):
                if c0 != c1: break
            else:
                res += 1
        return res

    a, b = map(int, input().split())
    print(cnt(b) - cnt(a - 1))

main()

Solution (Python):


import sys










def main():
    a, b = (int(x) for x in sys.stdin.read().split())

    count = 0
    for n in range(a, b+1):
        n = str(n)
        if n == n[::-1]:
            count += 1

    print(count)       

if __name__ == "__main__":
    
    main()

Solution (Python):
a,b = map(int,input().split())
result=0
for i in range(a,b+1):
    c=i
    d=list(str(i))
    d.reverse()
    if d==list(str(i)):
        result +=1
print(result)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        ans += 1
print(ans)

Solution (Python):
a, b = map(int, input().split())

print(sum([1 for i in range(a, b+1) if str(i) == str(i)[::-1]]))

Solution (Python):
a, b = map(int, input().split())

lst = [1 for i in range(a, b+1) if str(i) == str(i)[::-1]]
print(sum(lst))

Solution (Python):
a, b = map(int, input().split())

cnt = 0
for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        cnt += 1

print(cnt)

Solution (Python):
A, B = [int(num) for num in input().split()]

count = 0
for num in range(A, B+1):
  target = str(num)
  target_list = list(target)
  target_list_reversed = reversed(target_list)
  target_list_reversed = list(target_list_reversed)
  
  if target_list == target_list_reversed:
    count = count + 1
print(count)

Solution (Python):
a,b = map(int,input().split())
c = 0
for i in range(a,b+1):
    s = str(i)
    if s == s[::-1]:
        c+=1
print(c)

Solution (Python):
A, B = [int(i) for i in input().split()]
bag=[]
for i in range(A, B+1):
    aa = str(i)
    if aa ==aa[::-1] :
        bag.append(i)

print(len(bag))

Solution (Python):
m,n=map(int,input().split())
j=0
for i in range(m,n+1):
    c=int(i/10000)
    d=int(i/1000%10)
    e=int(i/100%10)
    f=int(i/10%10)
    g=int(i%10)
    if((c+d*10+e*100+f*1000+g*10000)==i):
        j+=1
print("%d"% j)

Solution (Python):
a,b=input().split()

a=int(a)

b=int(b)

num=0

for i in range(a,b+1):

    num1=str(i)

    num2=num1[::-1]

    if num1==num2:
 
        num=num+1

print(num)

Solution (Python):
A, B = map(int, input().split())
def isP(number):
    s = str(number)
    length = len(s)
    for i in range(int(length / 2)):
        if s[i] != s[length-i-1]:
            return False
    return True

res = 0
for i in range(A, B+1):
    if (isP(i)):
        res += 1
print(res)

Solution (Python):
a,b= map(int,input().split())
ans = 0
for n in range(a,b+1):  
  n_str = str(n)    
  add = 1
  for i in range(2):
    if n_str[i] != n_str[-(1+i)]:
      add = 0
  ans += add

print(ans)

Solution (Python):
a,b = map(int, input().split())
print(sum(i==i[::-1] for i in map(str, range(a,b+1))))

Solution (Python):
a,b = map(int, input().split())
c = 0
for i in range(a,b+1):
  s = str(i)
  if s == s[::-1]:
    c += 1
print(c)

Solution (Python):
a,b = map(int, input().split())
c = 0
for i in range(a,b+1):
  s = str(i)
  if s[0] == s[-1] and s[1] == s[-2]:
    c += 1
print(c)

Solution (Python):
A,B = map(int,input().split())

ans = 0
for i in range(A,B+1):
    if str(i)==str(i)[::-1]:
        ans += 1

print(ans)

Solution (Python):
a,b = map(int,input().split())
ans=0
for i in range(a,b+1):
    if str(i) == str(i)[::-1]:
        ans+=1
print(ans)

Solution (Python):
A,B = map(int,input().split())
ans = 0
for i in range(A, B+1):
  if str(i) == ''.join([s for s in str(i)[::-1]]): ans += 1 
print(ans)

Solution (Python):
a, b = map(int, input().split())

c = 0

for i in range(a, b+1):
    s = i % 10
    t = int(i / 10000) % 10
    u = int(i / 10) % 10
    v = int(i / 1000) % 10
    if s == t and u == v:
        c += 1

print(c)

Solution (Python):
if __name__ == '__main__':

	f,t = list(map(int,input().split()))

	cnt = 0
	for s in range(f,t+1):
		if str(s) == str(s)[::-1]:
			cnt  += 1

	print(cnt)

Solution (Python):
A,B=map(int,input().split())
count=0
for i in range(A,B+1):
  o=str(i)
  l="".join(list(reversed(o)))
  if o==l:
    count+=1
print(count)

Solution (Python):
A, B = map(int, input().split())
cnt = 0
for i in range(A, B + 1):
  o = str(i)
  r = ''.join(list(reversed(o)))
  if o == r:
    cnt += 1
print(cnt)

Solution (Python):
A,B = list(map(int,input().split()))
ans = 0
for n in range(A,B+1):
  ans += 1 if str(n) == str(n)[::-1] else 0
print(ans)

Solution (Python):
A,B = list(map(int,input().split()))
ans = 0
for n in range(A,B+1):
  if str(n) == str(n)[::-1]:
    ans += 1
print(ans)

Solution (Python):
A,B = map(int,input().split())
tmp = []
count = 0
for i in range(A,B+1):
    tmp.append(i)
for j in range(len(tmp)):
    flag = 1
    if len(str(tmp[j]))%2 == 0:
        for k in range(int(len(str(tmp[j]))/2)):
            if str(tmp[j])[k] != str(tmp[j])[-k-1]:
                flag = 0
                break
    else:
        for l in range(int(len(str(tmp[j]))//2)):
            if str(tmp[j])[l] != str(tmp[j])[-l-1]:
                flag = 0
                break
    if flag == 1:
        count += 1
print(count)

Solution (Python):
def isPalindrome(n):
  n = str(n)
  for i in range(len(n)//2 + 1):
    if n[i] != n[-(i+1)]:
      return False
  return True

A, B = map(int, input().split())

count = 0
for i in range(A, B+1):
  if isPalindrome(i):
    count += 1

print(count)

Solution (Python):
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
    t_list = list(str(i))
    if t_list[0] == t_list[4] and t_list[1] == t_list[3]:
        count += 1
print(count)

Solution (Python):
a, b = map(int, input().split())

ans = 0
tmp = ''

for num in range(a, b+1):
    tmp = str(num)
    if(tmp[0] == tmp[-1] and tmp[1] == tmp[-2]):
        ans += 1

print(ans)

Solution (Python):
a,b = input().split()

cnt = 0
for var in range(int(a),int(b)+1):
	if str(var) == str(var)[::-1]:
		cnt = cnt + 1
	else:
		pass
print(cnt)

Solution (Python):
a,b = map(int,input().split())
count = 0
for i in range(a, b+1):
  num_list = list(str(i))
  num_rev = list(reversed(num_list))
  if num_list == num_rev:
    count += 1
print(count)

Solution (Python):
a,b = map(int,input().split())

ans = 0

for i in range(a,b+1):
    if str(i)[0]==str(i)[-1] and str(i)[1]==str(i)[-2]:
        ans += 1
else:
    print(ans)

Solution (Python):
a,b = map(int, input().split())
n = b-a
count = 0
for i in range(n+1):
    s = str(a+i)
    if s[0] == s[4] and s[1] == s[3]:
        count += 1
print(count)