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):
A,B =[int(i) for i in input().split()]
num = 0
for i in range(A,B+1):
    n = i
    s=[]
    while(n>0):
        s.append(str(n%10))
        n //= 10

    s_rev = ''.join(s[::-1])
    s = ''.join(s)
    if(s == s_rev):
        num += 1
print(num)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    s = SR(3)
    for i in range(3):
        print(s[i][i], end="")
    print()
    return


def B():
    a, b = LI()
    ans = 0
    for i in range(a, b + 1):
        x = str(i)
        for k in range(len(x)//2):
            if x[k] != x[-k - 1]:
                break
        else:
            ans += 1
    print(ans)
    return


def C():
    return


def D():
    return


if __name__ == '__main__':
    B()

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

def check(x):
    y = str(x)
    return y == y[::-1]

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

print(ans)

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

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math





 
def main():
    a, b = map(int, input().split())
    
    ans = 0
    for i in range(a, b+1):
        s = str(i)
        flg = True
        for j in range(len(s)):
            tmp = (j * -1) -1
            if s[j] != s[tmp]:
                flg = False
        if flg == True:
            ans += 1
    
    print(ans)
	
if __name__ == "__main__":
	main()

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

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

A = A_B[0]
B = A_B[1]

p_number = 0

for num in range(A, B + 1):
    num_list = [int(x) for x in list(str(num))]
    half = int(len(num_list) / 2)
    end = len(num_list)
    judge = 0
    for j in range(half):
        if num_list[j] == num_list[end - j - 1]:
            continue
        else:
            judge += 1

    if judge == 0:
        p_number += 1

print(p_number)

Solution (Python):

def judge(num):
	num_list_pre =list()
	num_list_late =list()
	num_list = list(str(num))		 
	num_list_pre.extend(num_list[:int(len(num_list)/2):])
	num_list_late.extend(num_list[int(len(num_list)/2)+1:])
	if num_list_pre == list(reversed(num_list_late)):
		return True
	else:
		return  False

A,B = map(int,input().split())
count =0
for i in range(A,B+1):
		if judge(i):
			 count +=1
print(count)

Solution (Python):
a, b = map(int, input().split())
print(sum(map(lambda x: 1 if str(x) == str(x)[::-1] else 0, range(a, b+1))))

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

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

ans = 0

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

Solution (Python):
a,b = map(int,input().split())
a1 = a//100
b1 = b//100
a2 = a//1000
b2 = b//1000
a3 = ((a2)%10)*10 + (a2%100)//10
b3 = ((b2)%10)*10 + (b2%100)//10
a4 = a%100
b4 = b%100
count = 0
if a3 >= a4:
    count = count + 1
if b3 <= b4:
    count = count + 1
if b1 - a1 == 0:
    if count == 2:
        print(1)
    else:
        print(0)
else:
    print(b1-a1-1+count)

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

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

d = 0
for i in range(a, b+1):
    c = str(i)
    e = True
    for j in range(len(c)//2):
        if c[j] != c[-j-1] and e:
            e = not e
    if e:
        d += 1
print(d)

Solution (Python):
def findSumDigit(num):
    global total
    total = ""
    while num > 0:
        total += str(num % 10)
        num //= 10
    return total

def main():
    a,b = map(int, input().split())
    ans = 0
    for i in range(a,b+1):
        tmp = str(findSumDigit(i))
        if tmp == str(i):
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
A, B = map(int, input().split())
ans = 0
for num in range(A, B+1):
    s = str(num)
    rev_s = "".join(list(s)[::-1])

    if s == rev_s:
        ans += 1

print(ans)

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

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

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

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

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

Solution (Python):



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

for i in range(A, B + 1):
    string = str(i)
    if string[0] + string[1] == string[-1] + string[-2]:
        ctr += 1
print(ctr)

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

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

Solution (Python):
a,b=map(int,input().split())
c=0
d=0
for i in range(a,b+1):
  i =str(i)
  d=1
  for j in range(len(i)//2):
    if i[j]!=i[len(i)-j-1]:
      d=0
  if d==1:
    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 = list(map(int, input().split(" ")))
ans = 0
for i in range(a, b + 1):
    s = str(i)
    ans += s[:2] == s[3:][::-1]
print(ans)

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

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

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

print(sum_s)

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

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

print(sum_n)

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

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

Solution (Python):
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):
a, b = map(int, input().split())

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

Solution (Python):



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

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

Solution (Python):
a, b = map(str, input().split())
count = 0
for i in range(int(a), int(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())
count = 0
for i in range(A, B+1):
  if str(i)[0] == str(i)[4] and str(i)[1] == str(i)[3]:
    count += 1
print(count)

Solution (Python):



def read_h(typ=int):
    return map(typ, input().split())


def read_v(n, typ=int):
    return [typ(input()) for _ in range(n)]


def main():
    a, b = read_h()
    cnt = 0
    for i in range(a, b + 1):
        s = str(i)
        if s[:2] == s[3:][::-1]:
            cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()

Solution (Python):
a,b=map(int,input().split())
lx=[]
cnt=0
for i in range(a,b+1):
    t=i
    kai=0
    for j in range(5):        
        t2=t%10
        kai=kai+t2*10**(4-j)
        t=t//10
    
    if(kai==i):
        cnt=cnt+1
print(cnt)

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

Solution (Python):
from bisect import bisect_left, bisect_right
a,b = map(int,input().split())
l_1=range(10,100)
l_2=range(0,10)
l=[]
for i in l_1:
    for j in l_2:
        tmp=int(str(i)+str(j)+str(i)[::-1])
        l.append(tmp)
print(bisect_right(l,b)-bisect_left(l,a))

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

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

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

Solution (Python):
a, b =  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())

def is_palindromic(n):
    l = list(str(n))
    l.reverse()
    return n == int("".join(l))

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

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

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

print(res)

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

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

print(res)

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

ans = sum([1 if str(num) == str(num)[::-1] else 0 for num in range(A, B+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):
row = input().split()
A = int(row[0])
B = int(row[1])
count = 0
for i in range(A, B+1):
    s = list(str(i))
    if s == list(reversed(s)):
        count += 1
print(count)

Solution (Python):
A,B=map(int,input().split())
ans=0
for i in range(A,B+1):
  a=str(i)
  listA=list(a)
  listA.reverse()
  rev="".join(listA)
  if a==rev:
    ans+=1
print(ans)

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

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=map(int, input().split())
cnt=0
for i in range(A,B+1):
  jun=str(i)
  if jun==jun[::-1]:
    cnt+=1

print(cnt)

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

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

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

cnt=0
for num in range(a,b+1):
    if int(str(num)[0:2])==int(str(num)[4]+str(num)[3]):
        cnt+=1
print(cnt)

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

print(ans)

Solution (Python):
a,b = map(str, input().split())
count = 0
num = a
sub = 0
line = int(b) - int(a) + 1

for i in range(line):
	if num[0] == num[4] and num[1] == num[3]:
		count = count + 1
	sub = int(num) + 1
	num = str(sub)
	
print(count)

Solution (Python):
import math
A,B = map(int,input().split())
ans = 0
for i in range (A,B+1):
    s = str(i)
    kai = True
    for j in range (0, math.ceil(len(s)/2)):
        if s[j] != s[-j - 1]:
            kai = False
            break
    if kai == True:
        ans += 1
print(ans)

Solution (Python):
A, B = map(int, input().split())
ans = 0
for i in range(A, B+1):
  num = str(i)
  if num == num[::-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());print(sum(s==s[::-1]for s in map(str,range(a,b+1))))

Solution (Python):

import time
import re
import math
import fractions

def main():
    A,B=map(int,input().split())
    count=0
    for a in range(A,B+1):
        s=str(a)
        r="".join(reversed(list(s)))
        if s==r:
            count+=1
    print(count)
    
    
start=time.time()
main()

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

Solution (Python):

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


if __name__ == "__main__":
    main()

Solution (Python):
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    a, b = map(int, input().split())

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

    print(count)

Solution (Python):
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    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):
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    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 = [int(ab) for ab in input().split()]
ans = 0
for AB in range(A, B+1):
  AB_str = str(AB)
  for i in range(len(AB_str)//2):
    if AB_str[i] != AB_str[-i-1]:
      break
  else:
    ans += 1
print(ans)

Solution (Python):
a,b=input().split()
if a!='10000':
  a=str(int(a)-1)
def f(x):
  c=int(x[0])
  d=int(x[1])
  m=(c-1)*100+d*10
  e=int(x[2])
  g=int(x[3])*10+int(x[4])
  if g<d*10+c:
    m+=e
  else:
    m=m+e+1
  return m
print(f(b)-f(a))

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

kaibun = 0 
for i in range(A,B+1,1):
  s = str(i)
  
  for i in range(len(s)):
    if s[i] != s[len(s)-1-i]:
      break
    if i == len(s)-1:
      kaibun += 1
print(kaibun)

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

A, B = nl()

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

Solution (Python):
def resolve():
	a,b=map(str,input().split())
	s=int(a[:2])
	e=int(b[:2])
	ans=0
	for i in range(s,e+1):
		for j in range(10):
			kai=i*1000+j*100+int(str(i)[::-1])
			if int(a)<=kai<=int(b):
				ans+=1
	print(ans)
resolve()

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

P = [0] * (B + 1)
for i in range(10000,B + 1):
  if (i // 10000 == i % 10) and ((i // 1000) % 10 == (i // 10) % 10):
    P[i - 9999] = P[i - 10000] + 1
  else:
    P[i - 9999] = P[i - 10000]
print(P[B - 9999] - P[A - 10000])

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

cnt = 0

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

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

Solution (Python):
def isSym(x):
  y = str(x)
  z = y[::-1]
  return y == z

a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
  ans += isSym(i)
print(ans)

Solution (Python):
def abc():
    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)


abc()

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    A, B = (int(_) for _ in input().split())
    cnt = 0
    for i in range(A,B+1):
        if str(i) == str(i)[::-1]:
            cnt += 1
    print(cnt)
    
if __name__ == '__main__':
    main()

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())
tmp = ''
ans = 0
for i in range(A,B+1):
    tmp = str(i)
    if tmp == tmp[::-1]:
        ans += 1
print(ans)

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

Solution (Python):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

















A, B = list(map(int, sys.stdin.readline().split()))

ans = 0
for i in range(A, B+1):
    ans += str(i) == ''.join(list(reversed(str(i))))
print(ans)

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

cnt = 0
for i in range(a,b+1):
  if i//10000 == i%10 and (i//1000)%10 == (i//10)%10:
    cnt += 1
print(cnt)

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

setes = set()
for i in range(1,10):
  for j in range(10):
    for k in range(10):
      setes.add(10001*i + 1010*j + 100*k)
print(len(set(range(a,b+1))&setes))

Solution (Python):
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):
a, b = map(int, input().split())
count = 0
for i in range(b - a + 1):
    l = len(str(a + i))
    if l % 2 != 0:
        l = l - 1
    check = 0
    for j in range(l // 2):
        if int(str(a + i)[j]) == int(str(a + i)[l - j]):
            check += 1
    if check == l // 2:
        count += 1
print(count)

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

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

def is_palind(x):
  s = str(x)
  return s == s[::-1]

answer = 0
for n in range(a,b+1):
  if is_palind(n):
    answer += 1

print(answer)

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

Solution (Python):

A,B = input().split()

A = int(A)
B = int(B)

ans = 0

for i in range(B - A + 1):
    
    i += A
    
    i = str(i)
    
    rot = ""
    
    for j in i:
        
        rot = j + rot
        
    if i == rot :
        
        ans += 1
        
        
print (ans)

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):
ab = input().split(" ")
start = int(ab[0])
stop = int(ab[1])+1
ans = 0
for i in range(start, stop):
  x = i%10*10 + int(i/10)%10
  y = int(i/1000)
  
  
  if x==y:
    ans = ans+1
   
print(ans)

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


def solve(A: int, B: int):
    print(len([ i for i in range(A,B+1) if str(i) == str(i)[::-1] ]))




def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(A, B)

if __name__ == '__main__':
    main()

Solution (Python):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    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())
ans = 0
for i in range(a,b+1):
    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):
  if str(i) == str(i)[::-1]:
    cnt += 1
print(cnt)

Solution (Python):
i = input().split(' ')
counter = 0

for i in range(int(i[0]),int(i[1])+1):
  if str(i) == str(i)[::-1]:
    counter +=1

print(counter)

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

def judge(x):
  L = [0] * 5
  for i in range(5):
    L[i] = x % 10
    x //= 10
  if L[0] == L[4] and L[1] == L[3]:
    return 1
  else:
    return 0

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

print(ans)

Solution (Python):
a, b = map(int,input().split())
c = list(range(a,b+1))
count = 0
for i in c:
  j = str(i)
  if j[0] == j[4] and j[1] == j[3]:
    count += 1
print(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())
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())
c=0
for i in range(a,b+1):
    i=str(i)
    if i[:2]==i[3:][::-1]:c+=1
print(c)

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

Solution (Python):
def dsum(n,x):
  for i in range(n-1):
    x //= 10
  return x % 10  

a, b = map(int, input().split())
total = 0
for i in range(a,b+1):
  if dsum(1,i) == dsum(5,i) and dsum(2,i) == dsum(4,i):
    total += 1
print(total)

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

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

j=0

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

print(j)

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

count = 0
for i in range (A,B+1,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

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

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

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

Solution (Python):
A, B = [int(i) for i in 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())
k=0
for i in range(A,B+1):
    if i == int(str(i)[::-1]):
        k+=1
print(k)

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

Solution (Python):
a,b = map(int,input().split())
ls = [str(x) for x in range(a,b+1)]

flg = 0

for i in ls:
    if (i[0]==i[4]) and (i[1]==i[3]):
        flg += 1
        
print(flg)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    s=list(str(i))
    k=0
    for j in range(5):
        k+=int(s[j])*(10**j)
    if i==k:
        ans+=1
print(ans)

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

for i in range(B - A + 1):
	num = str(A + i)
	if num[0] == num[4] and num[1] == num[3]:
		ans += 1

print(ans)

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

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

print(cnt)

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

count = 0
for i in range(A, B+1):
    if i//10000 == i%10 and (i//1000)%10 == (i%100)//10:
        count += 1 

print (count)

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

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

Solution (Python):
def check(s):
    return all(s[i] == s[-i-1] for i in range(len(s)//2))

A, B = [int(x) for x in input().split()]

print(sum(check(str(n)) for n in range(A, B+1)))

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

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

print(result)

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

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

print(ans)

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

ans=0
for i in range(A,B+1):
    s=str(i)
    l=len(s)
    if all( s[j]==s[l-1-j] for j in range(l) ): 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(" "));print(len([i for i in range(A,B+1) if str(i)==str(i)[::-1]]))

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 n in range(a, b+1):
    if str(n)[0] == str(n)[4] and str(n)[1] == str(n)[3]:
        ans += 1
print(ans)

Solution (Python):
A, B = map(int, raw_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):
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):
    now = str(i)
    tmp =  now[::-1]
    if now == tmp:
        count += 1
print(count)

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

cnt = 0
for i in range (A, B+1):
    a = (i // 10000) % 10 
    b = (i // 1000) % 10 
    c = (i // 10) % 10 
    d = i % 10 
    if a == d and b == c:
        cnt += 1

print(cnt)

Solution (Python):
a, b = [ int(v) for v in 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())
x=[]
for i in map(str,range(a,b+1)):
    if i==i[::-1]:
        x.append(i)

print(len(x))

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

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

print(result)

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

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

Solution (Python):

import sys


def solve(A: int, B: int):
    def is_pal(n):
        s = str(n)
        for i in range(len(s)):
            if s[i] != s[-1 - i]:
                return False
        return True
    ret = 0
    for i in range(A, B + 1):
        if is_pal(i):
            ret += 1
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(A, B)

if __name__ == '__main__':
    main()

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

Solution (Python):
a,b = map(int, input().split())
c = 0
for i in range(a, b+1):
    s = str(i)
    sr = "".join(list(reversed(s)))
    if s== sr:
        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):



import math
import statistics

cnt = 0
keta = []
a,b = map(int, input().split())
for i in range(a,b + 1):
  n = i
  for j in range(5):
    keta.append(n % 10)
    n = n // 10
  if keta[0] == keta[4] and keta[1] == keta[3]:
    cnt = cnt + 1
  keta = []
print(cnt)

Solution (Python):
a, b = list(map(int, input().split()))
total = 0
for i in range(a, b+1):
  if (i%10 == i//10000%10) and (i//10%10 == i//1000%10):
    total += 1
print(total)

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

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

for i in range(A,B+1):
    figure = list(str(i))
    inverse = figure[::-1]
    if figure == inverse:
        result += 1
print(result)

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

Solution (Python):
from sys import stdin
A,B=[int(x) for x in stdin.readline().rstrip().split()]
ans=0
for i in range(A,B+1):
    if str(i)[:2] == str(i)[-2:][::-1]:
        ans+=1
print(ans)