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):


def main():
    s = input().split()
    sa, sb = s[0], s[1]
    a, b = int(sa), int(sb)
    ap = int(sa[0] + sa[1] + sa[2] + sa[1] + sa[0])
    bp = int(sb[0] + sb[1] + sb[2] + sb[1] + sb[0])
    da = int(a / 100)
    db = int(b / 100)
    if ap < a:
        da += 1
    if b < bp:
        db -= 1


    print(db - da + 1)


if __name__ == '__main__':
    main()

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

Solution (Python):
a, b = (int (i) for i in input().split())
kotae = 0
for i in range(a, b+1):
    s = i % 10
    t = i /10000 % 10
    u = i / 10 % 10
    v = i / 1000 % 10
    if (int(s)==int(t) and int(u)==int(v)) :
        kotae+=1

print(kotae)

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

print(ans)

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

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
print(count)

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):
def isPalin(s):
    for i in range(len(s)):
        if s[i]!=s[len(s)-1-i]:
            return False
    return True

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


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

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

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

Solution (Python):

import sys
input = sys.stdin.readline

A, B = map(int, input().split())
ans = 0
for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            val = 10000*i + 1000*j + 100*k + 10*j + i
            if A <= val <= B:
                ans+=1
print(ans)

Solution (Python):

import sys
input = sys.stdin.readline

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

Solution (Python):

import sys
input = sys.stdin.readline

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

Solution (Python):
import sys

input = sys.stdin.readline


def ii():
    return int(input())


def il():
    return list(map(int, input().split()))


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

Solution (Python):
import sys

input = sys.stdin.readline


def ii():
    return int(input())


def il():
    return list(map(int, input().split()))


A, B = il()
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

A, B = map(int, input().split())
flag = True
count = B-A+1
for i in range(A, B+1):
    for j in range(int(math.ceil(len(str(A)))/2)):
        if str(i)[j] != str(i)[-1-j]:
            count -= 1
            break
print(count)

Solution (Python):
import math

A, B = map(int, input().split())
flag = True
count = 0
for i in range(A, B+1):
    for j in range(int(math.ceil(len(str(A)))/2)):
        if str(i)[j] != str(i)[-1-j]:
            count -= 1
            break
    count += 1
print(count)

Solution (Python):
import sys
import math

min_, max_ = [int(_) for _ in sys.stdin.readlines()[0].strip().split(' ')]

res = []
for i in range(min_, max_+1):
  target = str(i)
  flag = True
  for n in range(len(target)):
    
    if not target[n] == target[-(n+1)]:
      flag = False
  if flag:
    res.append(i)

print(len(res))

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

    if(i[0] == i[4] and i[1]== i[3]):
        count+=1
print(count)

Solution (Python):



def checkPalindrom(number):
	numberString = str(number)
	if (numberString[0] == numberString[-1]) and (numberString[1] == numberString[-2]):
		result = True
	else:
		result = False
	return result

def  countPalindrom(checkRange):
	count = 0
	for number in checkRange:
		result=checkPalindrom(number)
		if result :
			count=count+1
	answer = count
	return answer

if __name__ == '__main__':
	A,B = map(int,input().strip().split(' '))
	checkRange = range(A,B+1,1)
	solution=countPalindrom(checkRange)
	print("{}".format(solution))

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

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

def is_palind(x):
  sx = str(x)
  if sx[0]==sx[-1] and sx[1]==sx[-2]:
    return True
  else:
    return False

c = 0
for a in range(A, B+1):
  if is_palind(a):
    c+=1

print(c)

Solution (Python):



def main():
    """Function."""
    a, b = map(int, input().split())

    counter = 0
    for num in range(a, b+1):
        line = list(str(num))
        if line == line[::-1]:
            counter += 1

    print(counter)


if __name__ == "__main__":
    main()

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):
    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())
ans = 0
def f(x):
    return list(str(x))
for x in range(A,B+1):
    if f(x)[0] == f(x)[4] and f(x)[1] == f(x)[3]:
        ans += 1
print(ans)

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


if __name__ == '__main__':
    main()

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

count = 0

for i in range(a,b+1):
    S = []
    t = i
    while t!=0:
        s = t%10
        S.append(s)
        t//=10
    if S[0]==S[4] and S[1]==S[3]:
        count += 1

print(count)

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().strip().split(" "))
count=0

for i in range(0,B-A+1):
    C=A+i
    l=[int(x) for x in list(str(C))]
    if(l[0]==l[4] and l[1]==l[3]):
        count+=1

print(count)

Solution (Python):

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

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

    is_ok = True
    
    for n in range(len(s) // 2) :
        if (s[n] != s[-n-1]) :
            is_ok = False
            break
    if (is_ok):
        count += 1

print(count)

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


abc090_b()

Solution (Python):


A,B=input().split() 
cnt_print=0;
for i in range(int(A),int(B)+1):
  if (str(i)[0:2] == str(i)[4:5]+str(i)[3:4]):
    cnt_print=cnt_print+1
    
print (cnt_print)

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

Solution (Python):
def checkPalindrome(a,b):
    count=0
    for i in range(100,1000):
        p1=str(i//10)
        p2=str(i%10)
        p3=int(p1+p2+p1[1]+p1[0])
        if b>=p3 and p3>=a:
            count+=1
    return count


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

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

result = 0
for i in range(a, b + 1):
    i_str = str(i)
    idx_of_half = len(i_str) // 2
    first_half = i_str[:idx_of_half]
    if len(i_str) % 2 != 0:
        idx_of_half += 1
    second_half = i_str[idx_of_half:]

    if first_half == second_half[::-1]:
        result += 1

print(result)

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

Solution (Python):

a, b = map(int, input().split())
s = set()
for i in range(b+1)[a::]:
    i = str(i)
    if i[0] == i[4] and i[1] == i[3]:
        s.add(i)
print(len(s))

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

Solution (Python):
a,b=input().split()
a=int(a)
b=int(b)
ans=0
for i in range(a,b+1):
    a=i//10000
    b=i//1000%10
    c=i//100%10
    d=i//10%10
    e=i%10
    if a==e and b==d:
        ans+=1
print(ans)

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

result = 0
for i in range(a, b + 1):
    i_str = str(i)
    border = len(i_str) // 2

    first_half = i_str[:border]
    if len(i_str) % 2 != 0:
        border += 1
    second_half = i_str[border:]

    compared = second_half[::-1]
    if first_half == compared:
        result += 1

print(result)

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())
k = 0
for i in range(a, b+1):
  if i//10000 == i % 10 and i//1000 - (i//10000 *10) == (i%100 - i%10)/10:
    k = k + 1
print(k)

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

cnt=0

for j in range(int(a),int(b)+1):
  s=''
  strj=str(j)
  for i in range(len(strj)):
    s+=strj[len(strj)-1-i]
    if strj==s:
      cnt+=1
    
print(cnt)

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

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

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

print(result)

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

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

c = 0
for i in range(A, B + 1):
	if unicode(i) == "".join(reversed(unicode(i))):
		c += 1
print c

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

print(ans)

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

Solution (Python):
import itertools
palindromic_numbers = [0] * 100001
for i, j, k in itertools.product(range(1, 10), range(10), range(10)):
    palindromic_numbers[i * 10000 + j * 1000 + k * 100 + j * 10 + i] = 1
A, B = [int(_) for _ in input().split()]
print(sum(palindromic_numbers[A:B + 1]))

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):
    if str(i) == str(i)[::-1]:
        count += 1
print(count)

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

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

a = l[0]
b = l[1]
counter = 0

for i in range(a, b+1):
	word = str(i)
	d = len(word)

	left = word[:d//2]
	right = word[-(d//2):]
	right_r = right[::-1]
	if left == right_r:
		counter += 1
	
print(counter)

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

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%100//10:
        cnt += 1
print(cnt)

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

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

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

Solution (Python):
a, b = map(int, input().split())
c = 0
for i in range(a, b + 1):
  x = str(i)
  y = ''.join(reversed(x))
  if x == y:
    c += 1
print(c)

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

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

ans = 0
for x in range(10):
    for y in range(10):
        for z in range(1, 10):
            num = 10000*z + 1000*y + 100*x + 10*y + z
            if a <= num and num <= b:
                ans += 1

print(ans)

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

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

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

print(ANS)

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

Solution (Python):
from sys import stdin


def main() -> None:
    a, b = [int(next_str()) for _ in range(2)]
    ans = 0

    for i in range(a, b + 1):
        ans += int(judge(i))

    print(ans)


def judge(a: int) -> bool:
    s = str(a)
    n = len(s)

    for i in range(n // 2):
        if s[i] != s[n - i - 1]:
            return False

    return True


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin


def main() -> None:
    a, b = [int(next_str()) for _ in range(2)]
    ans = 0

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

    print(ans)


def judge(a: int) -> bool:
    s = str(a)
    n = len(s)

    for i in range(n // 2):
        if s[i] != s[n - i - 1]:
            return False

    return True


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

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

for x in range(A, B+1):
	if x//10000 == x%10 and x//1000 % 10 == x//10 % 10:
		ans += 1

print(ans)

Solution (Python):


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

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

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

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

Solution (Python):
a,b = (int(_) for _ in input().split())

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

print(ans)

Solution (Python):
a,b=map(str,input().split( ))
a_12 = int(a[0:2])
a_3 = int(a[2])
a_45 = int(a[3:5])
b_12 = int(b[0:2])
b_3 = int(b[2])
b_45 = int(b[3:5])
a_21 = int(a[1]+a[0])
b_21 = int(b[1]+b[0])
ans = (b_12-a_12+1)*10 - a_3 - (10 - b_3 - 1)
if a_21 < a_45:
    ans = ans - 1
if b_21 > b_45:
    ans = ans - 1
print(ans)

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

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

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

print(ans)

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

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

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

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

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

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

print(ans)

Solution (Python):
a, b = [int(m) for m in input().split(" ")]

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

Solution (Python):
def f(i):
  return str(i)==str(i)[-1::-1]

s=input().split()
res=0
for i in range(int(s[0]),int(s[1])+1):
  if f(i):
    res+=1
print(res)

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

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

cnt = 0

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

print(cnt)

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

Solution (Python):
s,e = map(int,input().split())
count=0

for n in range(s,e+1):
    s=str(n)
    frag=0
    for m in range(len(s)//2): 
        if s[m]!=s[-m-1]:
            frag=1
    if frag==0:
        count+=1

print(count)

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

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

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


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

cnt = 0
for i in range(a, b+1):
	if kaibunnsuu(i) == True:
		cnt += 1
		
print(cnt)

Solution (Python):
a,b = map(int,input().split()) 
c = 0
for i in range(1,10):
  for j in range(0,10):
    for k in range(0,10):
      x = 10001*i+1010*j+100*k
      if x >= a and x <= b:
        c += 1
print(c)

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

ans = 0

for i in range(b - a + 1):
    n = a + i
    l = list(str(n))
    lr = list(reversed(l))

    if l == lr:
        ans += 1

print(ans)

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

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

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 number in range(a,b+1):
    if list(str(number)) == list(str(number))[::-1]:
        ans += 1
print(ans)

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

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

print(n_satisfied)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
  temp = []
  for j in range(5):
    d = 10**(4-j)
    p = i//d
    temp.append(p)
    i -= p*d
  if temp[0] == temp[4] and temp[1] == temp[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)
    rev = S[::-1]
    if S[:3] == rev[:3]:

        ans += 1
print(ans)

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

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

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

Solution (Python):
a, b = [int(v) for v in 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):
  s = str(i)

  if s[0] == s[-1] and s[1] == s[-2]:
    ans += 1
print(ans)

Solution (Python):
a,b = map(int,input().split())
answer = 0
for i in range(a,b+1) :
    j = str(i)
    p1 = j[4]
    p2 = j[3]
    p3 = j[2]
    p4 = j[1]
    p5 = j[0]
    k = int(p1+p2+p3+p4+p5)
    if i == k :
        answer += 1
print(answer)

Solution (Python):
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
  x=str(i)
  y=list(x)
  y.reverse()
  z=int(''.join(y))
  if i==z:c+=1
print(c)

Solution (Python):
a, b = map(int, input().split())
index =a
count =0
while index<b+1:
    charList = list(str(index))
    if charList[0] == charList[4] and charList[1] ==charList[3]:
        count+=1
    index+=1

print(count)

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

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

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

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

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):
    s = str(i)
    if s == s[::-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)
    if (s == s[::-1]):
        ans += 1

print(ans)

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

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

print(ans)

Solution (Python):
'''input
31415 92653
'''
a,b = map(int,raw_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):
    temp = str(i)
    i = str(i)
    i = i[::-1]
    if i == temp:
        cnt += 1
print(cnt)

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

kA = int(A[0:3]) * 100 + int(A[1:2]) * 10 + int(A[0:1])
kB = int(B[0:3]) * 100 + int(B[1:2]) * 10 + int(B[0:1])

maxB = int(B[0:3]) + int(kB <= int(B))
maxA = int(A[0:3]) + int(kA < int(A))

print(maxB - maxA)

Solution (Python):
a, b = map(int, input().split())
counter = 0
for i in range(a, b + 1):
  n = i
  rev = ''
  while n != 0:
    rev += str(n % 10)
    n //= 10
  if rev == str(i):
    counter += 1
print(counter)

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

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

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

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

print(result)

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

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, 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 = cnt + 1

print cnt

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

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

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

print(count)

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

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())
c=0
while a<=b:
    temp=str(a)
    a+=1
    if temp[0]==temp[-1] and temp[1]==temp[-2]:
        c+=1
print(c)

Solution (Python):
left, right = map(int, input().split())

def isKaibun(num):
    l1 = list(str(num))
    l2 = l1[::-1]
    if l1 == l2:
        return True
    else:
        return False

count = 0
for i in range(left, right+1):
    if isKaibun(i):
        count += 1

print(count)

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

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

def isKaibun(num):
    _s = str(num)
    if _s[0] == _s[4] and _s[1] == _s[3]:
        return True
    else:
        return False

for n in range(A, B+1):
    if isKaibun(n):
        cnt += 1
print(cnt)

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

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

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

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

print(ans)

Solution (Python):
cnt = 0
A, B = map(int, input().split())
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(a,b+1):
    num = list(str(i))
    kaibun = 0
    for j in range(int(len(num)/2)):
        if num[j] == num[len(num)-j-1]:
            kaibun += 1
    if kaibun == int(len(num)/2):
        count += 1

print(count)

Solution (Python):


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def main():
    A, B = map(int, input().split())
    ans = 0
    for a in range(A, B + 1):
        s = str(a)
        ans += (s == s[::-1])
    print(ans)

if __name__ == '__main__':
    main()

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


solve()

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 = 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());ans=0
for i in range(a,b+1):
    if str(i)==str(i)[::-1]: ans+=1
print(ans)