Problem:


Score : 200 points

Problem Statement

Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.

Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Constraints

S is a string consisting of lowercase English letters.

The length of S is between 1 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

Print the minimum number of hugs needed to make S palindromic.

Sample Input 1

redcoder

Sample Output 1

1

For example, we can change the fourth character to o and get a palindrome redooder.

Sample Input 2

vvvvvv

Sample Output 2

0

We might need no hugs at all.

Sample Input 3

abcdabc

Sample Output 3

2



Sample input:
redcoder


Sample output:
1

Submission status: Wrong Answer

Solution code:
def isPalindrome(Str): 
  
    Len = len(Str) 
  
  
    if (Len == 1): 
        return True
  
  
    ptr1 = 0
  
  
    ptr2 = Len - 1
  
    while (ptr2 > ptr1): 
  
        if (Str[ptr1] != Str[ptr2]): 
            return False
        ptr1 += 1
        ptr2 -= 1
  
    return True
  
def noOfAppends(s): 
  
    if (isPalindrome(s)): 
        return 0

    del s[0] 
  
    return 1 + noOfAppends(s) 
  
se = "abede"
s = [i for i in se] 
print(noOfAppends(s))

Submission status: Wrong Answer

Solution code:
S = input()
ans=0
L=len(S)
l=int(L/2)
if l%2==1:
    l=l-1
for n in range(l):
    if not(S[n]==S[L-(n+1)]):
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
S = input()
s = list(S) #文字を一文字ずつリスト格納
count=0
N=int(math.ceil(len(s)/2))

for i in range(N):
 if not s[i]==s[N-i-1]:
  count+=1

print(count)

Submission status: Wrong Answer

Solution code:
from sys import stdin
lines = stdin.readlines()
 
S = lines[0]
S0 = len(S)
Sl = list(S)

if S0%2 == 0 :
  l = 0
  cnt = 0
  for j in reversed(range(int(S0 / 2), S0)):
    if not Sl[l] == Sl[j]:    
      cnt += 1
    l += 1
  print(cnt)
else:
  l = 0
  cnt = 0
  for j in reversed(range(int((S0 + 1) / 2), S0)):
    if not Sl[l] == Sl[j]:    
      cnt += 1
    l += 1
  print(cnt)

Submission status: Wrong Answer

Solution code:
def palin(S):
    lst = list(S)
    num = len(lst)//2
    count = 0
    for i in range(num):
        if not lst[i] == lst[-i-1]:
            count += 1
    return count

S = input()
palin(S)

Submission status: Wrong Answer

Solution code:
from sys import stdin
lines = stdin.readlines()
 
S = lines[0]

S0 = len(S)
#print(S0)
Sl = list(S)
#print(Sl[0])

if S0%2 == 0 :
  l = 0
  cnt = 0
  for j in reversed(range(int(S0 / 2), S0)):
    #print(l, j)
    if not Sl[l] == Sl[j]:    
      cnt += 1
    l += 1
  print(cnt)
else:
  l = 0
  cnt = 0
  for j in reversed(range(int((S0 + 1) / 2), S0)):
    #print(l, j)
    if not Sl[l] == Sl[j]:    
      cnt += 1
    l += 1
  print(cnt)

Submission status: Wrong Answer

Solution code:
S = input()
len_S = len(S)
c = 0
s = len_S // 2
for i in range(s-1):
    if S[i] is not S[len_S-1 -i]:
        c += 1
print(c)

Submission status: Wrong Answer

Solution code:
S = str(input())


half = len(S) // 2

front = list(S[half::])
back = list(S[half-1:: -1])

count = 0

for i in range(half):
    if front[i-1] == back[i-1]:
        count += 0
    else:
        count += 1
        
print(count)

Submission status: Wrong Answer

Solution code:
S = input()
len_S = len(S)
c = 0
s = len_S // 2
for i in range(s-1):
    if S[i] != S[len_S-1 -i]:
        c += 1
print(c)

Submission status: Wrong Answer

Solution code:
s = input()
sb = s[:len(s)//2]
if len(s) % 2 == 1:
    sa = s[len(s)//2+1:]
else:
    sa = s[len(s)//2:]
sa = sa[::-1]
cnt = 0
for b in sb:
    for a in sa:
        if b != a:
            cnt += 1
        break
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
input  = sys.stdin.readline
 
S=input()
R=list(S)
R.reverse()
R = "".join(R)
l = int(len(S)/2)
rtn=0
for i in range(l):
  if S[i]!=R[i]:
    rtn+=1
print(rtn)

Submission status: Wrong Answer

Solution code:
s = list(input())
l = len(s)
m = l//2
h = 0
count=0
if l%2!=0:
  h = 1
for i in range(m):
  if s[i]!=s[m+i+h]:
  	count+=1
print(count)

Submission status: Wrong Answer

Solution code:
S = input()

m = int(len(S) / 2)

ans = 0
for i in range(0, m + 1):
    if S[i] != S[len(S) - 1 - i]:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
counter = 0
nstring = input()
rstring = nstring[::-1]
for i in range(len(nstring)):
  if nstring[i] != rstring[i]:
  	counter += 1
print(counter/2)

Submission status: Wrong Answer

Solution code:
s=input()
s=list(s)
a=0

for i in range((len(s))//2):
    print(s[-(i+1)])
    if s[i]!=s[-(i+1)]:
        a+=1
print(a)

Submission status: Wrong Answer

Solution code:
S = input()
len_S = len(S)
c = 0
s = len_S // 2
for i in range(s-1):
    if S[i] == S[len_S-1 -i]:
        c += 1
cal = s - c
print(cal)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input().strip()
S1=S[::-1]
count=0
for i in range(len(S)):
    if S[i] != S1[i]:
        count= count+1

print(count)

Submission status: Wrong Answer

Solution code:
S=list(input())
C=len(S)
#print(S)
#print(S[1])
D=0
for n in range(C):
        if S[n]!=S[C-n-1]:
            D=D+1
print(D/2)

Submission status: Wrong Answer

Solution code:
import math
N = list(input())

def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

change_num = math.floor(len(N) / 2)
ans = 0
count = 1
for i in N[:change_num]:
    if N[-count] != i:
        ans += 1    
    
print(ans)

Submission status: Wrong Answer

Solution code:
S = str(input())
Slist = list(S)
newlist = list(reversed(Slist))
ans = 0
for i in range((len(S)//2)):
  if Slist[i] == newlist[i]:
    ans += 1
    
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
s2 = list(reversed(s))

ans = 0

for i in range(len(s)):
  if s[i] != s2[i]:
    ans += 1
    if (len(s) % 2 == 0 and i == int(len(s) / 2)):
      ans -= 1

print(ans)

Submission status: Wrong Answer

Solution code:
counter = 0
nstring = input()
rstring = nstring[::-1]
for i in range(len(nstring)):
  if nstring[i] != rstring[i]:
  	counter += 1
print(counter)

Submission status: Wrong Answer

Solution code:
import math

def countHugs(input_string):
  string_arr = [char for char in input_string]
  pointerA = string_arr[0]
  pointerB = string_arr[-1]
  hugs = 0
  for r in range(0, (math.ceil(len(string_arr)/2)) - 1):
    if pointerA != pointerB:
      hugs += 1
    pointerA = string_arr[r]
    pointerB = string_arr[-r]
  print(hugs)

if __name__ == "__main__":
    input_string = input()
    countHugs(input_string)

Submission status: Wrong Answer

Solution code:
s = input()
rs = s[::-1]
flg = False
odd = 0
if len(s) % 2 == 1:
    flg = True
    odd = len(s) // 2 + 1
cnt = 0
for i,c in enumerate(s):
    if flg and i == odd:
        break
    for rc in rs:
        if c != rc:
            cnt += 1
        break
print(cnt)

Submission status: Wrong Answer

Solution code:
S=list(map(str,input()))
N=len(S)
cnt=0
SR=S[:]
SR.reverse()
print(*SR)
for i in range(N):
  if S[i]!=SR[i]:
    cnt=cnt+1
print(cnt//2)

Submission status: Wrong Answer

Solution code:
a=input().strip()
x=len(a)
x1=x//2
c=0
for i in range(x1+1):
  if a[i]!=a[x-1-i]:
    c+=1
print(c)

Submission status: Wrong Answer

Solution code:
S = list(input())
N = len(S)

p = 0 #スライス前
o = 0 #変更回数
u = N #スライス後


if N % 2 == 0:
    for i in range(int(N/2)):
        if S[p] == S[u-1]:
            p += 1
            u -= 1
        else:
            o += 1
else:
    for i in range(int(N/2)-1):
        if S[p] == S[u-1]:
            p += 1
            u -= 1
        else:
            o += 1

print(o)

Submission status: Wrong Answer

Solution code:
s = str(input())
s2 = s[::-1]
count = 0
for i in range(len(s)):
    if not (s[i]==s2[i]):
        count +=1

print(count)

Submission status: Wrong Answer

Solution code:
n = input()
n = list(n)
print(n)
m = len(n) 
A = 0
if m % 2 == 0:
    K = int(m/2)
    a = n[0:K]
    n.reverse()
    b = n[0:K]
else:
    K = int((m - 1) / 2)
    a = n[0:K]
    n.reverse()
    b = n[0:K]
for i, value in enumerate(a):
    if value != b[i]:
        A = A + 1

print(A)

Submission status: Wrong Answer

Solution code:
Y=str(input())#1行に沢山の数値(または文字)が並んでいる場合にリストに格納していく
X=[]
X=list(Y) #数値YをリストXに格納
print(X)
n=len(X)
m=0
if n%2==0:
    for i in range (0,n):
        if X[i]==X[n-i-1]:
            m=m+1
        else:
            m=m
    a=(n-m)/2
elif n%2==1:
    for i in range(0,n):
        if X[i]==X[n-i-1]:
            m=m+1
        else:
            m=m
    a=(n-m)/2
print(int(a))

Submission status: Wrong Answer

Solution code:
s = list(input())
rs=list(reversed(s))
count = 0

for i in range(len(s)):
    if s[i]!=rs[i]:
        count += 1
    print(s[i]+rs[i])
print(count-count//2)

Submission status: Wrong Answer

Solution code:
str = input()
l = len(str)
p = l-1
index = 0
cnt=0
while index < p:

    if str[index] == str[p]:
        index = index + 1
        p = p-1
        if index == p or index + 1 == p:
            if str[index] == str[p]:
                print(cnt)
                exit()
            else:
                cnt+=1
                print(cnt)
                exit()
    else:
        cnt+=1
        index = index + 1
        p = p-1
        if index == p or index + 1 == p:
            if str[index] == str[p]:
                print(cnt)
                exit()
            else:
                cnt+=1
                print(cnt)
                exit()

Submission status: Wrong Answer

Solution code:
S=input()
l=len(S)

count=0

if l%2==0:
    for i in range(l//2):
        if S[i]!=S[(l-1)-i]:
            count+=1
else:
    for j in  range((l-1)//2):
        if S[j]!=S[(j-1)-j]:
            count+=1

print(count)

Submission status: Wrong Answer

Solution code:
n = input()
x = 0
L = len(n)
for i in range(L):
    if i < L / 2:
        if n[i] != n[(i + 1) * -1]:
            x += 1
            print(n[i], n[(i + 1) * -1])

print(x)

Submission status: Wrong Answer

Solution code:
s = input()
count = 0
for i,ele in enumerate(list(s)):
    print(ele,s[::-1][i])
    if ele != s[::-1][i]:
        count+=1

print(count//2)

Submission status: Wrong Answer

Solution code:
a = input()
l = []
c = 0
for i in a:
  l.append(a)
n = len(a) // 2
for i in range(n):
  if l[i] != l[len(l) - i-1]:
    c += 1
print(c)

Submission status: Wrong Answer

Solution code:
S=input()
Skai=list(S)
Skai.reverse()
S=list(S)
num=len(S)
i=0
for j in range (num):
    if S[j]!=Skai[j]:
            i+=1
print(i)

Submission status: Wrong Answer

Solution code:
a = input()
l = []
c = 0
for i in a:
  l.append(a)
n = len(a) // 2
for i in range(n):
  if l[i] != l[len(l) - i-1]:
    c += 1

Submission status: Wrong Answer

Solution code:
string = str(input())
length = len(string)

t = 0
c = 0

def check(moji1,moji2):
    moji2 = list(moji2)
    moji1 = list(moji1)
    count = 0
    print(moji1+moji2)
    for i in range(t):
        if moji1[i] != moji2[i]:
            count += 1
    return count

if length % 2:
    t = int((length - 1)/2)
    mojimoji = list(string)
    newmoji1 = ""
    newmoji2 = ""
    for a in range(t):
        newmoji1 += mojimoji[a]
        newmoji2 += mojimoji[length-(1+a)]
    c = check(newmoji1,newmoji2)

else:
    t = int(length/2)
    mojimoji = list(string)
    newmoji1 = ""
    newmoji2 = ""
    for a in range(t):
        newmoji1 += mojimoji[a]
        newmoji2 += mojimoji[length-(1+a)]
    c = check(newmoji1,newmoji2)


print(c)

Submission status: Wrong Answer

Solution code:
str = input()
l = len(str)
p = l-1
index = 0
cnt=0
while index < p:

    if str[index] == str[p]:
        index = index + 1
        p = p-1
        if index == p or index + 1 == p:
            if str[index] == str[p]:
                print(cnt)
                exit()
            else:
                cnt+=1
                print(cnt)
                exit()
    else:
        cnt+=1
        index = index + 1
        p = p-1
        if index == p or index + 1 == p:
            print(cnt)
            exit()

Submission status: Wrong Answer

Solution code:
a = input("Enter word:")
b = a[::-1]
print(b)

Submission status: Wrong Answer

Solution code:
import math
import random
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
input = sys.stdin.readline
S = input()
num = len(S)
if num%2 == 0:
    left = S[:num//2]
    right = S[num//2:]
else:
    left = S[:num//2]
    right = S[num//2+1:]
right = right[::-1]
ans = 0
for i in range(len(left)):
    if left[i] != right[i]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
str = input()
count = 0
for i in range(int(len(str)/2)):
  if str[i] !=str[-i + 1]:
    count += 1
 
print(count)

Submission status: Wrong Answer

Solution code:
A = list(input())
B = list(reversed(A))
S = 0
for i in range((len(A)-1)//2):
    if A[i] != B[i]:
        S += 1
print(S)

Submission status: Wrong Answer

Solution code:
S = input()
S = "abcdabc"
LIST = list(S) #リストにすると、1文字毎に分割される。
lengs = len(LIST) #リス

count = int(0)

c = lengs // 2 


#中央は回文に必要ない要素なので処理しなくてもよい。

for i in range(c):
    #print(LIST[i])
    #print(LIST[lengs-i-1])
    #print("ばばばば")
    if LIST[i] == LIST[lengs-i-1]:
        count = count
    else:
        count = count  + 1
   
print(count)

Submission status: Wrong Answer

Solution code:

# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline 
readlines = sys.stdin.readlines

#n = int(input())
#a = [int(i) for i in readline().split()]


s = input()
ans = 0
n = len(s)
for i in range(n):
    if s[i] != s[-i]: ans += 1




print(ans//2)

Submission status: Wrong Answer

Solution code:
a =list(input())
b =int(int(len(a))/2)

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

Submission status: Wrong Answer

Solution code:
S = str(input())
S_l = list(S)
rS = list(reversed(S))
count = 0
print(S_l)
print(rS)
for i in range(len(S_l)):
    if(S_l[i] != rS[i]):
        count += 1
print(count // 2)

Submission status: Wrong Answer

Solution code:
s=list(input())
count=0
if len(s)%2==0:
    for i in range(1,(len(s)//2)+1):
        if s[i-1]!=s[-i]:
            count+=1
else:
    for i in range(1,len(s)//2):
        if s[i-1]!=s[-i]:
            count+=1
print(count)

Submission status: Wrong Answer

Solution code:
import sys
s = list(input())
ans = 0
print(s)
if len(s) == 1:
    print(0)
    sys.exit()

for i in range(len(s)//2):
    # print(s[i], s[-i-1])
    if s[i] != s[-(i+1)]:
        ans += 1
#         print(s[i])
# print(len(s)//2-1)
print(ans)

Submission status: Wrong Answer

Solution code:
s=str(input())
k=len(s)//2
c=0
for i in range(k):
    if s[i]!=s[k-i-1]:
        c+=1
print(c)

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s) // 2

sf = s[0:n]
ss = s[::-1]
sb = ss[0:n]
print(sf, sb)
cnt = 0
for i in range(n):
    if sf[i] != sb[i]:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from sys import stdin


def levenshtein(s1, s2):
    n, m = len(s1), len(s2)

    dp = [[0] * (m + 1) for _ in range(n + 1)]

    for i in range(n + 1):
        dp[i][0] = i

    for j in range(m + 1):
        dp[0][j] = j

    for i in range(1, n + 1):
        for j in range(1, m + 1):
            cost = 0 if s1[i - 1] == s2[j - 1] else 1
            dp[i][j] = min(dp[i - 1][j] + 1,         # insertion
                           dp[i][j - 1] + 1,         # deletion
                           dp[i - 1][j - 1] + cost)  # replacement

    return dp[n][m]


def main():
    # コンソール入力を受け取る
    S = stdin.readline().rstrip()
    front = S[:int(len(S) / 2)]
    back = S[-int(len(S) / 2):][::-1]

    print(levenshtein(front, back))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S=input()
hug=0
for i in range(len(S)//2):
    if S[i]!=S[-i]:
      hug+=1
print(hug)

Submission status: Wrong Answer

Solution code:
s =input()
last = len(s)-1
count=0
if(len(s)%2==0):
    for i in range(int(len(s)/2)):
        if(s[i]!=s[last]):
            count+=1
        last -= 1
elif(len(s)%2!=0):
    for i in range(int(len(s)//2)):
        if(s[i]!=s[last]):
            count+=1
            last -= 1

print(count)

Submission status: Wrong Answer

Solution code:
s = input()
rs = s[::-1]
l = len(s)
cnt = 0
for c in s:
    for rc in rs:
        if c != rc:
            cnt += 1
    break
print(cnt)

Submission status: Wrong Answer

Solution code:
s = input()
revS = s[::-1]
j = 0
for i in range(int(len(s)/2)):
    print("i "+str(i))
    if s[i] != revS[i]:
        j +=1
print(j)

Submission status: Wrong Answer

Solution code:
import sys

s = sys.stdin.read().strip()
c = 0
l = len(s)
print(int(l/2))
for i in range(int(l/2)):
  if s[i] != s[l-i-1]:
    c += 1
print(c)

Submission status: Wrong Answer

Solution code:
S = [i for i in input()]
S_len = len(S)
ans = 0
if (S_len % 2 == 0):
    a = S[0:int(S_len / 2)]
    b = S[int(S_len / 2):S_len][::-1]
    print(a,b)
    for i,j in zip(a,b):
        if not i == j:
            ans += 1
        else:
            continue
else:
    a = S[0:int(S_len / 2)]
    b = S[int(S_len / 2) + 1:S_len][::-1]
    print(a,b)
    for i,j in zip(a,b):
        if not i == j:
            ans += 1
        else:
            continue
print(ans)

Submission status: Wrong Answer

Solution code:
def B():
    S = input()
    odp = 0
    for i in range(len(S)//2): 
        if S[i] != S[-i-1]:
            odp += 1
    return odp 
B()

Submission status: Wrong Answer

Solution code:
c=list(input())
a=0
for i in range(1,len(c)//2+1):
    if c[i-1]!=c[-i]:
        a+=1
if len(c)==1:
    a+=1
print(a)

Submission status: Wrong Answer

Solution code:
S = input()
S = [i for i in S]
S_inverse = S[::-1]

print(S)
print(S_inverse)

ans = 0
for i in range(len(S)):
    if S[i] != S_inverse[i]:
        ans += 1
        
print(ans//2)

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
if N%2==1:
    L=S[0:N//2:1]
    R=S[-1:N//2:-1]
else:
    L=S[0:N//2:1]
    R=S[-1:N//2-1:-1]
print(S,L,R)
ans=0
for i in range(N//2):
    if L[i]!=R[i]:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
s=list(input())
count=0
if len(s)%2==0:
    for i in range((len(s)//2)+1):
        if s[i-1]!=s[-i]:
            count+=1
else:
    for i in range((len(s)//2)):
        if s[i-1]!=s[-i]:
            count+=1
print(count)

Submission status: Wrong Answer

Solution code:
s = input()
a = []
b = []
cnt = 0
if len(s)%2 == 0:
    a = list(s[:int(len(s)/2)])
    b = list(s[int(len(s)/2):])
else:
    a = list(s[:int((len(s)-1)/2)])
    b = list(s[int((len(s)+1)/2):])
for i in range(len(a)):
    b.reverse()
    if a[i] != b[i]:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
n = input()
index = 0
count = 0

while True:
    if len(n) / 2 < index:
        break
    if n[index] != n[(index*-1) - 1]:
        count += 1
    index += 1
print(count)

Submission status: Wrong Answer

Solution code:
s = input()
counter = 0
length = len(s)

for i in range(length):
  if s[i] != s[length-1-i]:
    counter += 1
    
print(counter)

Submission status: Wrong Answer

Solution code:
S = input()
n = len(S)

cnt1 = 0
cnt2 = 0

if n%2 == 0:
    for i in range(0, n//2):
        #print(S[i], S[-i-1])
        if S[i] != S[-i-1]:
            cnt1 += 1
    print(cnt1)
else:
    for i in range(0, n//2):
        #print(S[i], S[-i-1])
        if S[i] != S[-i]:
            cnt1 += 1
    print(cnt1)

Submission status: Wrong Answer

Solution code:
S = input()

cnt = 0
for i in range(len(S) // 2):
  print('{} {}'.format(S[i],S[-(i + 1)]))
  if S[i] != S[-(i + 1)]:
    cnt += 1

print(str(cnt))

Submission status: Wrong Answer

Solution code:
S = input()
count=0

mid = len(S)//2

for i in range(mid):
  print(S[i], S[-i-1])
  if S[i] != S[-i-1]:
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
if n%2:
  ms,us=s[:(n-1)//2],s[:(n-1)//2:-1]
else:
  ms,us=s[:n//2],s[:n//2+1:-1]
ans=0
for a,d in zip(list(ms),list(us)):
  if a!=d:ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
S = input().strip()
N = len(S) // 2
total = 0
for i in range(0, N):
  if S[i] != S[N - 1 - i]:
    total += 1
print(total)

Submission status: Wrong Answer

Solution code:
import math
s=input()
n=math.floor(len(s)/2)
print(n)
count=0
for i in range(n):
    if s[i]!=s[-i-1]:
        count+=1

print(count)

Submission status: Wrong Answer

Solution code:
S = input()
S_len = len(S)
num = 0
for i in range(S_len // 2):
  if S[i] != S[-i]:
    num += 1
print(num)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = input()
sum = 0
for i in range(len(s)//2):
    if s[i] != s[-i]:
        sum += 1
print(sum)

Submission status: Wrong Answer

Solution code:
S = str(input())

s_front = S[:len(S)//2]
s_rear = S[len(S)//2:]
s_front = s_front[::-1]

count = 0
for i, j in zip(s_front, s_rear):
    if i != j:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
import sys
input  = sys.stdin.readline

S=input()
R=list(S)
R.reverse()
R = "".join(R)
l = int(len(S)/2)
rtn=0
for i in range(l):
  if S[i]!=R[i]:
    rtn+=1
print(rtn)

Submission status: Wrong Answer

Solution code:
s = input()

l = len(s)
c = 0
for i in range(l):
    if s[i] != s[l-i-1]:
        c += 1
print(c/2)

Submission status: Wrong Answer

Solution code:
S=str(input())
count=0
for i in range(len(S)//2):
  print(S[i],S[-1-i])
  if S[i]!=S[-1-i]:
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
def palin(s):
    p1 = ans = 0
    p2 = len(s) - 1
    while p1 < p2:
        if s[p1] != s[p2]:
            ans += 1
        p1 += 1
        p2 -= 1
    print(ans)

if __name__ == "__main__":
    import sys
    in_str = ''
    for line in sys.stdin:
        in_str += line
    palin(in_str)

Submission status: Wrong Answer

Solution code:
S = list(input())

A = []
for i in S:
    A.append(i)
ans = 0
for i in range(len(S)):
    if S[i] != A[i]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

l = len(s)
ans = 0

for i in range(l//2):
	print(s[i],s[-i-1])
	if s[i] != s[-i-1]:
		ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin

S = stdin.readline().rstrip()
c = len(S) // 2
ans = 0
print(c)

for i in range(c):
    if S[i] != S[len(S) - i - 1]:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)
a = 0
for i in range(n//2):
  if s[i] != s[-i]:
    a += 1
print(a)

Submission status: Wrong Answer

Solution code:


S = input()

N = len(S)

if N == 1:
    print(0)

cnt = 0

for i in range(N//2):
    if S[i] != S[N-1-i]:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
s = input()
ls = len(s)
ans = 0
for i in range(ls//2):
    if s[i] != s[-1-i]:
        ans += 1
print(ans//2)

Submission status: Wrong Answer

Solution code:
s=list(input())
x=len(s)
c=0
for i in range((x+1)//2-1):
  if s[i]!=s[-i-1]:
    c+=1
print(c)

Submission status: Wrong Answer

Solution code:
s = input()
counter = 0

for i in range(len(s)//2):
  if s[i] != s[-i]:
    counter += 1
    
print(counter)

Submission status: Time Limit Exceeded

Solution code:
'''input
10 2
7 6 18 6 16 18 1 17 17
6 9 3 10 9 1 10 1 5
'''
# A coding delight
from sys import stdin, stdout
import gc
gc.disable()
 
import sys, time, threading


	
# main starts
string = stdin.readline().strip()
i = 0
j = len(string) - 1
count = 0
while i < j:	
	if string[i] != string[j]:
		count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
s = list(str(input()))

j = len(s)-1
i = 0
ans = 0
while(i < j):
  if s[i] != s[j] :
    ans += 1
  else:
    continue
print(ans)

Submission status: Accepted

Solution code:
s = input()
n = len(s)
cnt = 0
i = 0
j = -1
d = 0
while d != n//2:
    if s[i] != s[j]:
        cnt += 1
    i+=1
    j-=1
    d+=1

print(cnt)

Submission status: Accepted

Solution code:
S = input()
S_ = S[::-1]

count = 0
for i in range(len(S)//2):
    if S[i] != S_[i]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def main():
    S = input()

    ans = 0
    for i in range(len(S)):
        if S[i] != S[-(i + 1)]:
            ans += 1
    print(ans // 2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A=input();print(sum(i!=j for i,j in zip(A,A[::-1]))//2)

Submission status: Accepted

Solution code:
S=input();print(sum(a!=b for a,b in zip(S,S[::-1]))//2)

Submission status: Accepted

Solution code:
S=input();N=len(S);print(sum(S[i]!=S[N-i-1] for i in range(N//2)))

Submission status: Accepted

Solution code:
S=input();c=0;N=len(S)
for i in range(N//2):c+=S[i]!=S[N-i-1]
print(c)

Submission status: Accepted

Solution code:
S=input()
print(sum(i!=j for i,j in zip(S,S[::-1]))//2)

Submission status: Accepted

Solution code:
S=input()
a=len(S)
print(sum(S[i]!=S[a-i-1]for i in range(a//2)))

Submission status: Accepted

Solution code:
s=input();n=len(s)-1;print(sum(s[i]!=s[n-i]for i in range(n+1))//2)

Submission status: Accepted

Solution code:
A=input();print(sum([A[i]!=A[::-1][i] for i in range(len(A))])//2)

Submission status: Accepted

Solution code:
S=input();c=0;N=len(S)
for i in range(N//2): c+=(S[i]!=S[N-i-1])
print(c)

Submission status: Accepted

Solution code:
s=input();print(sum(s[i]!=s[len(s)-i-1] for i in range(len(s)))//2)

Submission status: Accepted

Solution code:
A=input()
c=0
B=A[::-1]
for i in range(len(A)):
    if A[i]!=B[i]:
        c+=1
print(c//2)

Submission status: Accepted

Solution code:
S = input()
cnt = 0
N = len(S)
for i in range(N//2):
  if S[i] != S[N-i-1]:
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
S=input()
cnt = 0
for i in range(len(S)//2):
    if S[i] != S[len(S) - i - 1]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
s = input()
count = 0
for i in range(len(s)//2):
    if s[i] != s[-(i + 1)]:
        count+= 1
print(count)

Submission status: Accepted

Solution code:
import math
from decimal import *
import random
mod = int(1e9)+7

s = str(input())
n =len(s)
if(n%2==0):
    s1, s2 = s[:n//2], s[n//2:][::-1]
    ans =0
    for i in range(len(s1)):
        if(s1[i]!= s2[i]):
            ans+=1
    print(ans)
else:
    s1, s2 = s[:(n-1)//2], s[(n-1)//2:][::-1]
    ans = 0
    for i in range(len(s1)):
        if(s1[i]!= s2[i]):
            ans+=1
    print(ans)

Submission status: Accepted

Solution code:
s=input()
rs=s[::-1]
ans=0
for i in range (len(s)):
  if s[i] != rs[i]:
    ans+=1
print(ans//2)

Submission status: Accepted

Solution code:
s = list(input())
Le = len(s)//2
front = s[:Le+1]
back = s[-Le:]
count=0
for i in range(Le):
    if front[i] != back[-1-i]:
        count+=1
print(count)

Submission status: Accepted

Solution code:
S = input()

mid = len(S) // 2
count = 0
for i in range(mid):
    if S[i] != S[len(S)-1-i]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
s = input()
cnt = 0
for i in range(len(s)//2):
    if s[i]!=s[-(i+1)]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(len(s)//2):
    if s[i]!=s[-i-1]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
s=input()
ans = 0
for i in range(len(s)//2):
 if s[i] != s[len(s)-1-i]:
  ans+=1

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin, stdout # only need for big input

def solve():
    s = input() 
    left = 0
    right = len(s) - 1
    count = 0
    while left < right:
        count += (s[left] != s[right])
        left += 1
        right -= 1
    print(count)

def main():
    solve()


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()
import math
half = int(math.ceil(len(S)//2))
count = 0
for a,b in zip(S[:half], S[:-half-1:-1]):
  if a != b: count += 1
print(count)

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(len(s)//2):
  if s[i] != s[-1-i]:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
S=input()

def ans147(S:str):
    def_count=0
    for i in range(int(len(S)/2)):
        if S[i]!=S[-(i+1)]:
            def_count+=1
    return def_count
print(ans147(S))

Submission status: Accepted

Solution code:
s = input()

s = " " + s

ans = 0

if len(s) % 2 == 0:
    for i in range(1, len(s) // 2 + 1):
        if s[i] != s[i * -1]:
            ans += 1
else:
    for i in range(1, len(s) // 2 + 1):
        if s[i] != s[i * -1]:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
def resolve():
    s = input()
    n = len(s)
    a = s[:n//2]
    b = s[::-1][:n//2]
    cnt = 0
    for i in range(len(a)):
        if a[i] != b[i]:
            cnt += 1
    print(cnt)
resolve()

Submission status: Accepted

Solution code:
s, hug = input(), 0
for i in range(len(s) // 2):
	if s[i] != s[-(i+1)]:
		hug += 1
print(hug)

Submission status: Accepted

Solution code:
s=input()
s_re=s[::-1]
ans=0
for i in range(len(s)):
    if s[i]!=s_re[i]:
        ans+=1
print(ans//2)

Submission status: Accepted

Solution code:
S = input()
T = S[::-1]
cnt = 0
for i in range(len(S)//2):
    if S[i] != T[i]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import math

s=input()
count=0

for i in range(0,math.floor(len(s)/2)):
    if s[i]!=s[len(s)-i-1]:
        count=count+1

print(count)

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(len(s)//2):
    if s[i] != s[-1-i]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
s = input()
a = 0
for i in range(len(s) // 2):
    if s[i] != s[-(i + 1)]:
        a += 1
print(a)

Submission status: Accepted

Solution code:
s=str(input())
c=len(s)//2
e=0
for i in range(0,c):
    if(s[i]!=s[len(s)-1-i]):
        e=e+1
print(e)

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(len(s)//2):
    if s[i] != s[-(i+1)]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
s=input()
ans=0
n=len(s)
for i in range((n+1)//2):
    if s[i]!=s[-i-1]:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
S = input()
n = len(S)
c = 0
for i in range(n // 2):
    if S[i] != S[n - i - 1]:
        c += 1
print(c)

Submission status: Accepted

Solution code:
S = input()
listS = list(S)
cnt = 0
if len(S) % 2 == 0 :
    for i in range(len(S)//2) :
        if S[i] != S[-(i+1)] :
            cnt += 1
else :
    for i in range((len(S))//2) :
        if S[i] != S[-(i+1)] :
            cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
s=input()
cnt=0
l=len(s)-1
for i in range(len(s)//2):
    if s[i]!=s[l-i]:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
s = list(input())
ans = 0
r = list(reversed(s))

for i in range(len(s)//2):
    if s[i] != r[i]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3


def solve(S: str):
    return sum([a != b for a, b in zip(S, reversed(S))]) // 2


def main():
    S = input().strip()
    answer = solve(S)
    print(answer)


if __name__ == "__main__":
    main()