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
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """11009 11332"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """31415 92653"""
        output = """612"""
        self.assertIO(input, output)


def resolve():
    A, B = map(int, input().split())
    ans = 0
    for i in range(A, B+1):
        s = str(i)
        for j in range(3):
            if s[j] != s[-1-j]:
                break
        else:
            ans += 1
    print(ans)


if __name__ == "__main__":
    
    resolve()

Solution (Python):



import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """11009 11332"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """31415 92653"""
        output = """612"""
        self.assertIO(input, output)


def resolve():
    A, B = map(int, input().split())
    ans = 0
    for i in range(A, B+1):
        s = str(i)
        for j in range((len(s)+1)//2):
            if s[j] != s[-1-j]:
                break
        else:
            ans += 1
    print(ans)


if __name__ == "__main__":
    
    resolve()

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

sum = 0

for n in range(A, B+1):
    rev = 0
    m = n
    while n != 0:
        dig = n % 10
        rev = rev*10+dig
        n = n//10
    if(m == rev):
        sum += 1
print(sum)

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())
ans = 0
for i in range(A, B + 1):
    a = str(i)
    a_len = len(a)
    a_len_mid = len(a) // 2
    pre = a[:a_len_mid]
    pos = ''.join(list(reversed(a[(a_len_mid + 1):a_len])))
    
    if pos.startswith(pre):
        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())
cnt = 0
for i in range(A,B+1):
    if list(map(int, str(i))) == list(map(int, str(i)))[::-1]:
        cnt += 1
print(cnt)

Solution (Python):
def is_palindrome(char) -> bool:
	char_reverse = char[::-1]

	if char == char_reverse:
		return True
	else:
		return False
	

def main():
	A, B = map(int, input().split())
	ans = 0

	for num in range(A, B + 1):
		result = is_palindrome(str(num))

		if result:
			ans += 1

	print(ans)

  
if __name__ == "__main__":
  	main()

Solution (Python):
a,b=map(int,input().split())
lst=[0 for _ in range(10**4,10**5)]

for i,_ in enumerate(lst):
  w=str(10**4+i)
  if w[0]==w[-1] and w[1]==w[-2]:
    lst[i]=1

print(sum(lst[a-10**4:b+1-10**4]))

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

Solution (Python):

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

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

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

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):
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())
counter=0
for i in range(A,B+1):
  if str(i)[0]==str(i)[4] and str(i)[1]==str(i)[3]:
    counter+=1
print(counter)

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

ans = 0

for i in range(1, 9 + 1):
    for j in range(10):
        for k in range(10):
            i, j, k = str(i), str(j), str(k)
            kaibun = int(i+j+k+j+i)
            if A <= kaibun and kaibun <= B:
                ans += 1

print(ans)

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

ans = 0

for i in range(100, 1000):
    S = str(i)
    P = S + S[1] + S[0]
    ans += A <= int(P) <= B

print(ans)

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

Solution (Python):
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):
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):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

a, b = inintm()

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


def a(num):
    list_a = []
    while num > 0:
        list_a.append(num % 10)
        num = num // 10
    return list_a

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B = map(int, readline().split())

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):

 

 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 

 










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

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

print(ans)

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

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

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    A, B = LI()

    ans = 0

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

    print(ans)

if __name__ == '__main__':
    resolve()

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

res = 0

for i in range(100, 1000):
    s = str(i)
    t = s + s[1] + s[0]
    ti = int(t)
    if ti >= A and ti <= B:
        res += 1

print(res)

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

count = 0
for i in map(str, range(A, B+1)):
    if(i == i[::-1]):
        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())
ans=0
for i in range(A,B+1):
    temp=""
    tamp=i
    for j in range(len(str(i))):
        temp+=str(i%10)
        i=i//10
    if str(tamp)==temp:
        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):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

Solution (Python):

















import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

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 , raw_input().split())
def f(u): return u == u[::-1]
count = 0
for u in range(a, b+1):
	if f(str(u)):count +=1
print count

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

Solution (Python):
def get(s,t):
    return s // (10 ** (t - 1)) % 10


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

count = 0

for i in range(A,B+1):
    one = get(i,1)
    two = get(i,2)
    four = get(i,4)
    five = get(i,5)

    if one == five and two == four:
        count += 1

print(count)

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

    if res:
        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 == x[::-1]:
        ans += 1
print(ans)

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

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

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

print(ans)

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

cnt = 0

for i in range(a, b+1):
    if int(i / 10000) == i % 10:
        if int(i / 1000) % 10 == int(i % 100 / 10):
            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())
answer = 0
for i in range(A,B+1):
  if str(i) == str(i)[::-1]:
    answer += 1
print(answer)

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    a, b = i_map()

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

if __name__ == '__main__':
    main()

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):
'''
リストや文字列の並び替え
↓↓↓
https://note.nkmk.me/python-reverse-reversed/
'''
a,b=map(int,(input().split()))
ans=0

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

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

ans = 0
for i in range(A,B+1,1):
    tmp = list(str(i))
    is_kai = True
    for j in range(0,len(tmp),1):
        if tmp[j]!=tmp[len(tmp)-1-j]:
            is_kai=False
            break
    if is_kai:
        ans+=1

print(ans)

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

Solution (Python):


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

for index in range(A, B+1):
    s = str(index)
    if s[:2] == s[5:2:-1]: ret += 1

print(ret)

Solution (Python):
A,B = (int(X) for X in input().split())
Count = 0
for T in range(A,B+1):
    StrT = str(T)
    if StrT[0:2]==StrT[3:5][::-1]:
        Count += 1
print(Count)

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

Solution (Python):
A,B=map(int,input().split())
N = 0
res = 0
def checkPali(n):
  
  c = n%10
  a = n//10000
  b = (n - 10000*a)//1000
  d = (n - c)/10
  e = d%10
  if a == c and b == e:
    return True
  else:
    return False
for i in range(B-A+1):
  N = A + i
  if checkPali(N):
    res+=1
print(res)

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


if __name__ == "__main__":
    solve()

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

ans_list = [x for x in range(A, B+1) if list(str(x)) == list(reversed(str(x)))]
print(len(ans_list))

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

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

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):
def is_palindromic(n):
    s = str(n)
    for i in range(len(s)//2 + 1):
        if s[i] != s[-i-1]:
            return False
    return True

A, B = list(map(int, input().split()))
ans = 0
for n in range(A, B + 1):
    if is_palindromic(n):
        ans += 1
print(ans)

Solution (Python):
s = input().split()
a = int(s[0])
b = int(s[1])

def palindromic(x):
    y = list(x)
    if not y[0] == y.pop():
        return False
    if not y[1] == y.pop():
        return False
    return True

answer = 0

for i in range(a, b + 1):
    if palindromic(str(i)):
        answer += 1
    
print(answer)

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

ans = 0
for i in range(a, b + 1):
    si = str(i)
    l = len(si)
    check = True
    for j in range(l // 2):
        if si[j] != si[(-j - 1)]:
            check = False
            break
    if check:
        ans += 1
print(ans)

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

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

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

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

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    a, b = map(int, input().split())
    r = 0
    for i1 in range(a, b + 1):
        c1 = i1 // 10000 == i1 % 10
        c2 = ((i1 // 1000) % 10) == ((i1//10)%10)
        r += c1 and c2
    print(r)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    a, b = map(int, input().split())
    r = 0
    for i1 in range(a, b + 1):
        stri1 = str(i1)
        r += stri1 == stri1[::-1]

    print(r)

if __name__ == '__main__':
    main()

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

Solution (Python):
a, b = map(int, input().split(" "))
count = 0
for v in range(a, b + 1):
    v1 = v % 10
    v2 = v // 10 % 10
    v3 = v // 100 % 10
    v4 = v // 1000 % 10
    v5 = v // 10000 % 10
    if v1 == v5 and v2 == v4:
        count += 1
print(count)

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

Solution (Python):
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 = 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):
    f = True
    str_i = str(i)
    lim = int(len(str_i) / 2)
    for j in range(lim):
        if str_i[j] != str_i[-j-1]:
            f = False
    if f:
        cnt += 1
print(cnt)

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

Solution (Python):


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

ans = 0
tmp_left = ''
tmp_right = ''

for x in range(A, B + 1):
    tmp_left = str(x)[0] + str(x)[1]
    tmp_right = str(x)[-1] + str(x)[-2]
    if tmp_left == tmp_right:
        ans += 1

print(ans)

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

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

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

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

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

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


def main():
    a, b = map(int, input().split())
    ans = 0
    for n in range(a, b + 1):
        c = str(n)
        l = len(c)
        circle = True
        for i in range(l // 2):
            if c[i] != c[-i-1]:
                circle = False
                break
        if circle: ans += 1
    print(ans)

if __name__ == "__main__":
    main()

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

ans = 0
for i in range(A,B+1):
    s = str(i)
    N = len(s)-1
    l = (len(s) // 2) + 1
    for j in range(l):
        if s[j] == s[N-j]:
            continue
        else:
            break
    else:
        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())
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, open(0).read().split())

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

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

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

print(answer)

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

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

Solution (Python):
A,B=map(int,input().split())
k=0
for i in range(A,B+1):
    if i//10000-i%10==0:
        j=i%10000//10
        if j//100-j%10==0:
            k=k+1


            
print(k)

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

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

print(ans)

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

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

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())
t = 0

for i in range(a,b+1):
    m = i // 1000
    n = i % 10 * 10 + i % 100 // 10
    if n == m:
        t += 1

print(t)

Solution (Python):
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):
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):
def check(i):
    i = str(i)
    return i[:2] == i[4:2:-1]

A, B = map(int, input().split())
res = sum(check(i) for i in range(A, B+1))
print(res)

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

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

Solution (Python):

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

ans = 0

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

    if k == gk:
        ans += 1

print(ans)

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

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

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

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

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

Solution (Python):

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


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

print(ans)

Solution (Python):
import sys
A,B = map(int,input().split())
if not ( 10000 <= A <= B <= 99999 ):
    sys.exit()

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())
number_list = list(range(a, b + 1))
ans = []
for i in range(len(number_list)):
    str_number = str(number_list[i])
    len_number = len(str_number)
    count = 0
    for j in range(len_number // 2):
        if str_number[j] != str_number[-1 - j]:
            break
        count += 1
    if count == len_number // 2:
        ans.append(str_number)
print(len(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=[int(i) for i in 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())

cnt = 0
for i in range(a, b+1):
  i = str(i)
  if all([i[0] == i[4], i[1] == i[3]]):
    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[::] == x[::-1]:
        count += 1

print(count)

Solution (Python):
def actual(A, B):
    is_palindrome = lambda i: str(i) == str(i)[::-1]

    return sum([is_palindrome(num) for num in range(A, B + 1)])

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

Solution (Python):
data = [int(i) for i in input().split(' ')]
A = data[0]
B = data[1]

count = 0
for i in range(A, B+1):
    i = str(i)
    l = len(str(i))
    l_half = l//2
    for j in range(l_half):
        if j == l_half-1:
            if i[j]==i[l-1-j]:
                count += 1
        if i[j]==i[l-1-j]:
            continue
        else:
            break
        
print(count)

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

Solution (Python):
A, B = list(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 = cnt + 1
print(cnt)

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

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

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