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



Sample input:
11009 11332


Sample output:
4

Submission status: Accepted

Solution code:
# coding: utf-8
def check(v):
    vs = str(v)
    length = len(vs)
    if length % 2 != 0:
        if vs[:length//2] == vs[length//2+1:][::-1]:
            return True
        else:
            return False
    else:
        if vs[:length//2] == vs[length//2:][::-1]:
            return True
        else:
            return False
A, B = map(int, input().split())
ans = 0
for v in range(A, B+1):
    # vs = str(v)
    # length = len(vs)
    # print(vs)
    # print(vs[:length//2], vs[length//2+1:][::-1])
    # break
    if check(v):
        # print(v)
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
A,B=map(int,input().split())
cnt=0

for i in range(A,B+1):
    si=str(i)
    flg=True
    for j in range(len(si)//2):
        if si[j]!=si[-(j+1)]:
            flg=False
    
    if flg:
        cnt+=1
        
print(cnt)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

#n, a, b= map(int, input().split())
a, b  = map(int, input().split())
#h = list(map(int, input().split()))
#s = list(str(input()))
#n = int(input())

tot = 0
count = 0

for i in range(a, b+1):
  n_str = list(str(i))
  integ  = [int(s) for s in n_str]
  integ_rev = integ[::-1]
  if (integ == integ_rev):
    count = count + 1

print(count)

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

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

Submission status: Accepted

Solution code:
def Is_cyc(x):
  s = str(x)
  for i in range(len(s)):
    if s[i] != s[-i-1]:
      return False
  return True

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

if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
def solve(a, b):
    f = lambda x, i: int(str(x)[i])
    fl1, fr1 = (f(a, 0), f(b, 0))
    fl2, fr2 = (f(a, 1), f(b, 1)) if fl1 == fr1 else (0, 9)
    fl3, fr3 = (f(a, 2), f(b, 2)) if fl2 == fr2 else (0, 9)
    return sum(
        a <= int('{0}{1}{2}{1}{0}'.format(i, j, k)) <= b
        for i in range(fl1, fr1 + 1)
        for j in range(fl2, fr2 + 1)
        for k in range(fl3, fr3 + 1)
    )

_a, _b = map(int, input().split())
print(solve(_a, _b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().rstrip().split(' ')]
cnt = 0
for i in range(A, B+1):
    arr = [i for i in list(str(i))]
    if not arr[0] == arr[-1]:
        continue
    
    asc = ''.join(arr)
    desc = ''.join(list(reversed(arr)))
    if asc == desc:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
def sumNum(num, sums):
    if num == 0:
        return sums
    sums += num % 10
    num = num // 10
    return sumNum(num, sums)

A, B = [int(i) for i in input().rstrip().split(' ')]
cnt = 0
for i in range(A, B+1):
    arr = [i for i in list(str(i))]
    if not arr[0] == arr[-1]:
        continue
    
    asc = ''.join(arr)
    desc = ''.join(list(reversed(arr)))
    if asc == desc:
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a,b = map(int,input().split())

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

Submission status: Accepted

Solution code:
def is_palindrome(n):
    n = str(n)
    return n == n[::-1]


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

ans = sum([1 for x in range(A, B + 1) if is_palindrome(x)])

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for i in range(a,b+1):
    s = str(i)
    if len(s) %2== 1:
        c = s[:len(s)//2]
        d = s[len(s)-1:len(s)//2:-1]
        if c == d:
            ans += 1
    else:
        c = s[:len(s)//2]
        d = s[len(s)-1:len(s)//2:-1]
        if c == d:
            ans += 1

print(ans)

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    rev_i=''.join(list(reversed(list(str(i)))))
    if(str(i)==rev_i):
        ans+=1
print(ans)

Submission status: Accepted

Solution code:


import numpy as np

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

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

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

Submission status: Accepted

Solution code:


import numpy as np

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

def check(x):
    s=str(x)
    for i in range(len(s)):
        if(s[i]!=s[len(s)-1-i]):return False
    return True

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
    l, rl = list(str(i)), list(reversed(str(i)))
    if l == rl:
        ans += 1

print(ans)

Submission status: Accepted

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

def check_palindromic(i):
  if i[0] == i[-1] and i[1] == i[-2]:
    return True
  else:
    return False

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
for i in range(100,999+1):
  Pal = str(i)
  Pal += Pal[1]+Pal[0]
  Palans = int(Pal)
  if A<=Palans<=B:
    ans+=1
print(ans)

Submission status: Accepted

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

ans = 0
for i in range(A, B+1):
    i = str(i)
    former = i[:2]
    latter = i[3:]
    if (int(former) % 11 == 0 and former == latter) or former == latter[::-1]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
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
  else:
    pass
  i+=1
print(count)

Submission status: Accepted

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

ansArray = []
i_str = ''
for i in range(B+1):
  i_str = str(i)
  i_str_zfilled = i_str.zfill(5)
  if i_str_zfilled[0] == i_str_zfilled[4] and i_str_zfilled[1] == i_str_zfilled[3]:
    ansArray.append(i)

count = 0
for ans in ansArray:
  if A <= ans <= B:
    count += 1

print(count)

Submission status: Accepted

Solution code:
l = [int(i) for i in input().split()]

ln = []
c = 0

for i in range(l[0],l[1]+1):
  ln.append(i)
  
# --
def palin(a):
  if a == a[::-1]:
    return 1
  else:
    return 0
# --
  
for i in range(len(ln)):
  c += int(palin(str(ln[i])))
  
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
A,B = [int(i) for i in input().split()]
count = 0
for i in range(A,B+1) :
    S = str(i)
    if S[0] == S[-1] and S[1] == S[3] :
        count+=1
print(count)

Submission status: Accepted

Solution code:
#coding:utf-8
a, b = map(int, input().split())
count = 0

for i in range(a, b+1):
    num = str(i)
    #print(num[0:2], num[3:5], num)
    #11211のようなパターン
    if num[0] == num[1] and num[0] == num[3] and num[0] == num[4]:
        count += 1
    #23532のようなパターン
    elif num[0] == num[4] and num[1] == num[3]:
        count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
count = 0

for i in range(x, y + 1):
  t = str(i)
  if t[0] == t[-1] and t[1] == t[-2]:
    count += 1

print(count)

Submission status: Accepted

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

cont = 0

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -coding: utf-8 -

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#N = int(input())
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)

Submission status: Accepted

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


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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


print(ans)

Submission status: Accepted

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


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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from bisect import bisect_left as bi_l, bisect_right as bi_r

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

##Just for prctice
a,b=map(int,input().split())

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

print(ans)


"""
11009 11332

4

31415 92653

612
"""

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


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


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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

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

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

print(count)

Submission status: Accepted

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

def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return array

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

total = 0

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

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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