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:
s = input()
l = len(s)
ans = 0
i = 1
j = 0
if l%2 == 0:
	while(j <= l/2 - 1):
		if s[j] != s[-i]:
			ans += 1
		j+=1
		i+=1
			
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
ans = 0
i = 1
j = 0
if l%2 == 0:
	while(j <= l/2):
		if s[j] != s[-i]:
			ans += 1
			
print(ans)

Submission status: Wrong Answer

Solution code:
S =input()
print(S)
#文字数をカウントする。
print(len(S))
count = 0
#文頭と文末の文字を比べる。
#同じであれば次の文字へ移行。
for i in range(len(S)//2):
  if S[i] == S[len(S) - i - 1]:
    i = i+1
    #異なる場合、1回カウント。
  else:
    i =i+1
    count = count + 1
print(count)

Submission status: Wrong Answer

Solution code:
#文字入力

s = input()

#逆順の文字列を作る

r = s[::-1]
#print("逆文字列",r)

nagasa = len(s)
#print("長さ",nagasa)

count=0
for i in range(nagasa):
	if s[i]==r[i]:
		count = count + 1

kekka=(nagasa-count)/2
if count==0:
	kekka=0

print(int(kekka))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()  # 複数の入力値を取得
num = int(len(s) / 2)
print(num)
j = len(s) - 1
ans = 0
for i in range(num):
    if s[i] != s[i + j]:
         ans += 1
    j -= 2

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

len_s = len(s)

total = 0

for i in range((len_s + 1) // 2):
    if s[i] == s[len_s - i - 1]:
        total += 1

print(total)

Submission status: Wrong Answer

Solution code:
s = input()

len_s = len(s)

total = 0

for i in range(len_s // 2):
    if s[i] == s[len_s - i - 1]:
        total += 1

print(total)

Submission status: Wrong Answer

Solution code:
s = input()
ans = 0
for c0, c1 in zip(s[:len(s)//2], s[-len(s)//2-1:-1]):
    if c0 != c1:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter

S = input()
cnt = Counter(S)
n_odd = 0
for _, n in cnt.items():
    if n & 1: n_odd += 1
if n_odd:
    print(2*((len(S) - n_odd) // (2*n_odd)) + 1)
else:
    print(len(S))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ANS)

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
h = l // 2
lis1 = []
lis2 = []
for i in range(0, h + 1):
  lis1.append(s[i])
  lis2.append(s[-(i + 1)])
count = 0
for a, b in zip(lis1, lis2):
  if a != b:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
import sys

# Take string input
string = input()

# Check string is alphabetical
if string.isalpha() is False:
    #print('Input is not alphabetical')
    sys.exit()

# Check string is all lowercase
if string.islower() is False:
    #print('Input is not lowercase')
    sys.exit()

# Check string length is between 1 and 100
if len(string) > 100 or len(string) < 1:
    #print('Input length is invalid (1-100)')
    sys.exit()

# Divide string into first and second half, compare reversed 2nd half
if len(string) % 2 == 1:
    string_1half = string[0:int(len(string)/2-0.5)]
    string_2half = string[:int(len(string)/2-0.5):-1]
elif len(string) % 2 == 0:
    string_1half = string[0:int(len(string)/2)]
    string_2half = string[:int(len(string)/2-1):-1]

# Compare two strings
string_compare = zip(string_1half, string_2half)
string_compare = dict(string_compare)
x = 0
for i, j in string_compare.items():
    if i != j:
        x += 1

# output count
print(x)

Submission status: Wrong Answer

Solution code:
a = input()
count = 0

#文字列を配列にいれている
#奇数の場合、list_beforeの方に多く入る
list_before = []
list_after = []
for i in a:
	if count < len(a)/2:
		list_before.append(i)
	else:
		list_after.append(i)
	count += 1

l = int(len(a)/2)
count = 0
if len(list_before)-len(list_after) == 1:
	for i in range(l-1):
		if list_before[i] != list_after[l-1 - i]:
			#list_before[i] = list_after[l-1 - i]
			count += 1
else: 
	for i in range(l):
		if list_before[i] != list_after[l-1 - i]:
			#list_before[i] = list_after[l-1 - i]
			count += 1
		

print(count)

Submission status: Wrong Answer

Solution code:
a = input()
count = 0

#文字列を配列にいれている
#奇数の場合、list_beforeの方に多く入る
list_before = []
list_after = []
for i in a:
	if count < len(a)/2:
		list_before.append(i)
	else:
		list_after.append(i)
	count += 1

l = int(len(a)/2)
count = 0
if len(list_before)-len(list_after) == 1:
	print(len(list_before))
	for i in range(l-1):
		if list_before[i] != list_after[l-1 - i]:
			#list_before[i] = list_after[l-1 - i]
			count += 1
else: 
	for i in range(l):
		if list_before[i] != list_after[l-1 - i]:
			#list_before[i] = list_after[l-1 - i]
			count += 1
		

print(count)

Submission status: Wrong Answer

Solution code:
import sys

# Take string input
string = input()

# Check string is alphabetical
if string.isalpha() is False:
    #print('Input is not alphabetical')
    sys.exit()

# Check string is all lowercase
if string.islower() is False:
    #print('Input is not lowercase')
    sys.exit()


# Check string length is between 1 and 100
if len(string) > 100 | len(string) < 1:
    #print('Input length is invalid (1-100)')
    sys.exit()

# Divide string into first and second half, compare reversed 2nd half
if len(string) % 2 == 1:
    string_1half = string[0:int(len(string)/2-0.5)]
    string_2half = string[int(len(string)/2+0.5):len(string)]
    string_2half = string_2half[::-1]
elif len(string) % 2 == 0:
    string_1half = string[0:int(len(string)/2)]
    string_2half = string[int(len(string)/2):int(len(string))]
    string_2half = string_2half[::-1]

# Compare two strings
string_compare = zip(string_1half, string_2half)
string_compare = dict(string_compare)
x = 0
for i, j in string_compare.items():
    if i != j:
        x += 1

# output count
print(x)

Submission status: Wrong Answer

Solution code:
import sys

# Take string input
string = input()

# Check string is alphabetical
if string.isalpha() is False:
    print('Input is not alphabetical')
    sys.exit()

# Check string is all lowercase
if string.islower() is False:
    print('Input is not lowercase')
    sys.exit()


# Check string length is between 1 and 100
if len(string) > 100 | len(string) < 1:
    print('Input length is invalid (1-100)')
    sys.exit()

# Divide string into first and second half, compare reversed 2nd half
if len(string) % 2 == 1:
    string_1half = string[0:int(len(string)/2-0.5)]
    string_2half = string[int(len(string)/2+0.5):len(string)]
    string_2half = string_2half[::-1]
elif len(string) % 2 == 0:
    string_1half = string[0:int(len(string)/2)]
    string_2half = string[int(len(string)/2):int(len(string))]
    string_2half = string_2half[::-1]

# Compare two strings
string_compare = zip(string_1half, string_2half)
string_compare = dict(string_compare)
x = 0
for i, j in string_compare.items():
    if i != j:
        x += 1

# output count
print(x)

Submission status: Wrong Answer

Solution code:
a = input()
count = 0

#文字列を配列にいれている
#奇数の場合、list_beforeの方に多く入る
list_before = []
list_after = []
for i in a:
	if count < len(a)/2:
		list_before.append(i)
	else:
		list_after.append(i)
	count += 1

l = int(len(a)/2)
count = 0
if len(list_before) % 2 == 1:
	for i in range(l-1):
		if list_before[i] != list_after[l-1 - i]:
			count += 1
else: 
	for i in range(l):
		if list_before[i] != list_after[l-1 - i]:
			count += 1
		

print(count)

Submission status: Wrong Answer

Solution code:
a = input()
count = 0

#文字列を配列にいれている
#奇数の場合、list_beforeの方に多く入る
list_before = []
list_after = []
for i in a:
	if count < len(a)/2:
		list_before.append(i)
	else:
		list_after.append(i)
	count += 1

l = int(len(a)/2)
count = 0
if len(list_before) % 2 == 1:
	for i in range(l-1):
		if list_before[i] != list_after[l-1 - i]:
			list_before[i] = list_after[l-1 - i]
			count += 1
else: 
	for i in range(l):
		if list_before[i] != list_after[l-1 - i]:
			list_before[i] = list_after[l-1 - i]
			count += 1
		

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
D = "redcoder"
Dr = D[-1:0:-1]

flag = 0

for i in range(len(D)-1):
  if D[i] != Dr[i]:
    flag += 1
    
print(flag-1)

Submission status: Wrong Answer

Solution code:
import re
print(re.sub('[aiueo]', '', input()))

Submission status: Wrong Answer

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

#print(S)
#print(invert_S)

ans = 0

for i in range(len(S)):
    #print(S[i],invert_S[i])
    if S[i] != invert_S[i]:
        ans += 1
        #print(invert_S[i],"→",S[i]," ",end="")
        invert_S = invert_S.replace(S[i],invert_S[i])
        #print(invert_S)
#print(invert_S)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

count = 0

for i, c in enumerate(s):
  if i >= (len(s) - 1) // 2:
    break
  if c != s[len(s) - 1 - i]:
    count += 1
    
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
s=input()
rev=s[::-1]
i=0
count=0

while i<len(s)//2:
	if s[i]!=s[::-(i+1)]:
		count+=1
	i+=1

print(count)

Submission status: Wrong Answer

Solution code:
s=input()
rev=s[::-1]
i=0
count=0

while i<len(s)/2:
	if s[i]!=s[::-i-1]:
		count+=1
	i+=1

print(count)

Submission status: Wrong Answer

Solution code:
s=input()
rev=s[::-1]
i=0
count=0

while i<len(s)//2:
	if s[i]!=s[::-i-1]:
		count+=1
	i+=1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
str = input()
lst = list(str)
count = 0

print(lst)
for i in range(int((len(lst))/2)):
  if lst[i] != lst[-i-1]:
    count += 1
  else:
    pass
print(count)

Submission status: Wrong Answer

Solution code:
str = input()
lst = list(reversed(str))
count = 0

print(lst)
for i in range(1,int((len(lst))/2)):
  if lst[i] != lst[-i-1]:
    count += 1
  else:
    pass
print(count)

Submission status: Wrong Answer

Solution code:
s = input()
c = 0
r = len(s) - 1
for i in s:
    c += 1 if i != s[r: r + 1] else 0
    r -= 1
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()[:-1]
ans=0
for f,r in zip(S,reversed(S)):
  if f==r:
    continue
  else:
    ans+=1
print(ans//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input().strip()
ans = len([x for x, y in zip(list(s), list(s[::-1])) if x != y])
print (ans)

Submission status: Wrong Answer

Solution code:
str = input()
count = 0

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

Submission status: Wrong Answer

Solution code:
S = input()

c = 0
for a, b in zip(S, S[-1]):
  if a == b:
    c += 1

print(len(S)-c)

Submission status: Wrong Answer

Solution code:
S = input()
n = len(S) // 2
c = 0;
for s1, s2 in zip(S[:n], S[n:]):
    if s1 != s2:
        c += 1
print(c)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def read():
    S = input().strip()
    print(S,)
    return S,


def solve(S):
    harf = len(S) // 2
    count = 0
    for i in range(harf):
        if S[i] != S[len(S) - 1 - i]:
            count += 1
    return count


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))

Submission status: Wrong Answer

Solution code:
# import sys
# input = sys.stdin.readline
s = input()
l = len(s)
count = 0
for i in range(l//2):
    if s[i]!=s[-i-1]:
        count += 1
    print(count)
    exit()

Submission status: Wrong Answer

Solution code:
# import sys
# input = sys.stdin.readline
s = input()
l = len(s)
count = 0
if l%2==0:
    for i in range(l//2):
        # print(i)
        # print(s[i])
        # print(s[-i-1])
        if s[i]!=s[-i-1]:
            count += 1
    print(count)
    exit()

Submission status: Wrong Answer

Solution code:
input_str = input()
str_len = len(input_str)-1
counter = 0
result = 0
if input_str == input_str[::-1]:
    print("0")
else:
    while (counter < str_len):
        if input_str[counter] == input_str[str_len-1]:
            result+=1
        counter += 1
print(int(result/2))

Submission status: Wrong Answer

Solution code:
S = input().split()
p=len(S)
t=0
for n in range(p):
  if S[n]!=S[p-n-1]:
    t+=1
print(int(t/2))

Submission status: Wrong Answer

Solution code:
input_str = input()
str_len = len(input_str)-1
counter = 0
result = 0
while (counter < str_len):
    if input_str[counter] == input_str[str_len-1]:
        result+=1
    counter += 1
print(int(result/2))

Submission status: Wrong Answer

Solution code:
input_str = input()
str_len = len(input_str)-1
counter = 0
result = 0
while (counter < str_len):
    print(input_str[counter], input_str[str_len-counter])
    if input_str[counter] == input_str[str_len-1]:
        result+=1
    counter += 1
print(int(result/2))

Submission status: Wrong Answer

Solution code:
#n = int(input())
#L = list(map(int,input().split()))
s = list(input())


s_r = []
for val in range(len(s)-1,-1,-1):
    s_r.append(s[val])

ans = 0
#print(s_r)
#wrong = []
for val in range(len(s)):
    if s[val] != s_r[val]:
        ans += 1

    #print(s[val],s_r[val])

print(ans-1)

Submission status: Wrong Answer

Solution code:
i = list(input())
a=len(i)
p=0
ans=0
for s in range(a):
    x=i[p]
    y=i[-p]
    if x==y:
        ans=ans+0
    else:
        ans=ans+1
    p=p+1
print(int(ans/2))

Submission status: Wrong Answer

Solution code:
i = list(input())
a=len(i)
p=0
ans=0
for s in range(a):
    x=i[p]
    y=i[-p]
    if x==y:
        ans=ans+1
    else:
        ans=ans+0
    p=p+1
print(int(ans/2))

Submission status: Wrong Answer

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

for i in range(list_len):

    if a[i] == a[len(a)-(i+1)]:
        print(a[i],a[len(a)-(i+1)])
        pass
    elif a[i] != a[len(a)-(i+1)]:
        print(a[i],a[len(a)-(i+1)])
        a[i] = a[len(a)-(i+1)]
    
print(a)

Submission status: Wrong Answer

Solution code:
s = list(input())
l = len(s)

s1 = s[:int(l/2)]
s2 = s[-int(l/2):]
s2.reverse()

print(s1)
print(s2)
dif = 0
for i in range(int(l/2)):
  print(i)
  if s1[i] != s2[i]:
    dif += 1

print(dif)

Submission status: Wrong Answer

Solution code:
S = input()
Slist = []
for i in range(len(S)):
    Slist.append(S[i]) 

count = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
def split(word): 
    return [char for char in word]  

def isPalindrome(s): 
	rev = ''.join(reversed(s)) 
	if (s == rev): 
		return True
	return False
# main function 
s = input().lower()
s1 = ""
ls = split(s)
ans = isPalindrome(s)
ans1 = isPalindrome(s1)
cnt = 0
r = len(s)
if (ans): 
	print(0)
else: 
	for i in range(r):
	    for j in range(26):
	        ls[i] = chr(j+97)
	        cnt += 1
	        s1.join(ls)
	        if (ans1):
	            print(cnt)
	            break
	        else:
	            continue
	    break

Submission status: Wrong Answer

Solution code:
S = input()
Slist = []
for i in range(len(S)):
    Slist.append(S[i]) 

count = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
input_str = input()
reverse_str = input_str[::-1]
couter = 0
char_couter = 0
if input_str == reverse_str:
    print("0")
else:
    for num in range(len(input_str)):
        if input_str[num] != reverse_str[num]:
            couter += 1
        
print(int(couter/2))

Submission status: Wrong Answer

Solution code:
import difflib, re
s = input()
s2=''.join(list(reversed(s)))
number_of_change = 0
diff = difflib.ndiff(s, s2)
for k in diff:
  if re.match(r"^-", k):
    number_of_change +=1
print(number_of_change)

Submission status: Wrong Answer

Solution code:
import math

if __name__ == "__main__":
    S = input()
    count = 0

    for i in range(math.floor(len(S))):
        if S[0+i] != S[-1-i]:
            count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
import math

if __name__ == "__main__":
    S = input().split()
    count = 0

    for i in range(math.floor(len(S))):
        if S[0+i] != S[-1-i]:
            count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
input_str = input()
reverse_str = input_str[::-1]
couter = 0
char_couter = 0
if input_str == reverse_str:
    print("0")
else:
    for char in input_str:
        if char != reverse_str[char_couter]:
            couter += 1
        char_couter += 1
        
print(int(couter))

Submission status: Wrong Answer

Solution code:
import math

if __name__ == "__main__":
    S = input().split()
    count = 0

    for i in range(math.floor(len(S))):
        if S[0+i] != S[-1]:
            count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
A = list(input())
import math
print(A)
B = math.ceil(len(A) / 2)
R = 0
print(B)
C = A[0:B]
D = A[-B:]
D = D[::-1]
count = 0
print(C)
print(D)
for i in range(B):
	if C[count] != D[count]:
		R += 1
	count += 1
print(str(R))

Submission status: Wrong Answer

Solution code:
s = input()


def levenshtein_distance(a, b):
    m = [[0] * (len(b) + 1) for i in range(len(a) + 1)]

    for i in range(len(a) + 1):
        m[i][0] = i

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

    for i in range(1, len(a) + 1):
        for j in range(1, len(b) + 1):
            if a[i - 1] == b[j - 1]:
                x = 0
            else:
                x = 1
            m[i][j] = min(m[i - 1][j] + 1, m[i][j - 1] + 1, m[i - 1][j - 1] + x)
    return m[-1][-1]


r = "".join(list(reversed(s)))
print(int(levenshtein_distance(s, r) / 2))

Submission status: Wrong Answer

Solution code:
input_str = input()
reverse_str = input_str[::-1]
couter = 0
char_couter = 0
if input_str == reverse_str:
    print("0")
else:
    for char in input_str:
        if char != reverse_str[char_couter]:
            couter += 1
        char_couter += 1
        
print(int(couter/2))

Submission status: Wrong Answer

Solution code:
s=0
s=input("Please input a word:")
length=len(s)
half=length/2
count=0
hug=0
while(count<half):
    if(s[count]!=s[length-count-1]):
        hug+=1
    else:
        pass
    count+=1
print("The number of hug is",hug,".")

Submission status: Wrong Answer

Solution code:
s = input()


def levenshtein_distance(a, b):
    m = [[0] * (len(b) + 1) for i in range(len(a) + 1)]

    for i in range(len(a) + 1):
        m[i][0] = i

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

    for i in range(1, len(a) + 1):
        for j in range(1, len(b) + 1):
            if a[i - 1] == b[j - 1]:
                x = 0
            else:
                x = 1
            m[i][j] = min(m[i - 1][j] + 1, m[i][j - 1] + 1, m[i - 1][j - 1] + x)
    # print m
    return m[-1][-1]


r = "".join(list(reversed(s)))
print(levenshtein_distance(s, r) / 2)

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)


S = str(input("input str: "))
st = [i for i in S]
print(noOfAppends(st))

Submission status: Wrong Answer

Solution code:
import math

str = input()
l = len(str)

if l % 2 == 1:  #奇数
  t = math.floor(l/2)
  d = str[0:t]
  dd = list(d)
  e = str[t:l]
  ee = list(reversed(e))

  ans = len(set(dd) & set(ee))
  
  print(t-ans)
        
else:  #偶数
  t = math.ceil(l/2)
  d = str[0:t]
  dd = list(d)
  e = str[t:l]

  ee = list(reversed(e))
  #print(ee)    
  #print(set(dd) & set(ee))
  ans = len(set(dd) & set(ee))
  print(t-ans)

Submission status: Wrong Answer

Solution code:
string = input()
n = len(string) - 1
if n == 1:
  print(0)
  exit(0)
    
s = 0 
e = n
count = 0
while e > s:
  if string[e] != string[s]:
    count += 1
  e -= 1
  s += 1
 
print(count)

Submission status: Wrong Answer

Solution code:
# Python 3 program for getting minimum character 
# to be added at front to make string palindrome 

# function for checking string is 
# palindrome or not 
def ispalindrome(s): 

	l = len(s) 
	
	i = 0
	j = l - 1
	while i <= j: 
	
		if(s[i] != s[j]): 
			return False
		i += 1
		j -= 1
	
	return True

# Driver code 
if __name__ == "__main__": 
	
	s = "BABABAA"
	cnt = 0
	flag = 0
	
	while(len(s) > 0): 
	
		# if string becomes palindrome then break 
		if(ispalindrome(s)): 
			flag = 1
			break
		
		else: 
			cnt += 1
		
			# erase the last element of the string 
			s = s[:-1] 
	
	# print the number of insertion at front 
	if(flag): 
		print(cnt) 

# This code is contributed by ita_c

Submission status: Wrong Answer

Solution code:
A = list(input())
B = round(len(A) / 2)
if len(A) % 2 != 0:
	A.pop(B - 1)
	B -= 1
R = 0
C = A[0:B]
D = A[-B:]
D = D[::-1]
count = 0
for i in range(B):
	if C[count] != D[count]:
		R += 1
	count += 1
print(str(R))

Submission status: Wrong Answer

Solution code:
S = "abcdabc"
R = S[::-1]
lis = []
for i in range(0, 7):
    if S[i] != R[i]:
        lis.append(S[i])

print(len(''.join(set(lis))))

Submission status: Wrong Answer

Solution code:
import math

str = input()
l = len(str)

if l % 2 == 1:  #奇数
  t = math.floor(l/2)
  d = str[0:t]
  #print(d)
  dd = list(d)
  #print(dd)
  e = str[t+1:l]
  #print(e)

  #list(set(d) - set([e]))
  ee = list(reversed(e))
  #print(ee)    
  #print(set(dd) & set(ee))
  ans = len(set(dd) & set(ee))
  print(t-ans)
        
else:  #偶数
  t = int(l/2)
  #print(t)
  d = str[0:t]
  #print(d)
  dd = list(d)
  #print(dd)
  e = str[t:l]
  #print(e)

  #list(set(d) - set([e]))
  ee = list(reversed(e))
  #print(ee)    
  #print(set(dd) & set(ee))
  ans = len(set(dd) & set(ee))
  print(t-ans)

Submission status: Wrong Answer

Solution code:
S = input()
zisyo = {}
count = 0
for item in S:
    if item not in zisyo:
        zisyo[item] = 1
    else:
        zisyo[item] += 1

#print(zisyo)

for i in zisyo:
    if zisyo[i]%2 != 0:
        count += 1

if count == 0:
    print(count)
elif count % 2 == 0:
    print(count - 1)
else:
    print(count + 1)

Submission status: Wrong Answer

Solution code:
import math

str = input()
l = len(str)

if l % 2 == 1:  #奇数
  t = math.floor(l/2)
  d = str[0:t]
  #print(d)
  dd = list(d)
  #print(dd)
  e = str[t+1:l]
  #print(e)

  #list(set(d) - set([e]))
  ee = list(reversed(e))
  #print(ee)    
  #print(set(dd) & set(ee))
  ans = len(set(dd) & set(ee))
  print(t-ans)
        
else:  #偶数
  t = int(l/2)
  print(t)
  d = str[0:t]
  #print(d)
  dd = list(d)
  #print(dd)
  e = str[t:l]
  #print(e)

  #list(set(d) - set([e]))
  ee = list(reversed(e))
  #print(ee)    
  #print(set(dd) & set(ee))
  ans = len(set(dd) & set(ee))
  print(t-ans)

Submission status: Wrong Answer

Solution code:
S = str(input("Enter String:"))
if len(S) > 100:
    print("Your string length must be less then 100!")
R = S[::-1]
lis = []
for i in range(len(S)):
    if S[i] != R[i]:
        lis.append(S[i])

print(len(''.join(set(lis))))

Submission status: Wrong Answer

Solution code:
S = list(input())
i = 0
count = 0
while i < len(S):
    if S[i] !=reversed(S[i]):
        count += 1
    i += 1
print(count)

Submission status: Wrong Answer

Solution code:
S = input().strip()
S1=S[::-1]
count=0
count1=0

middle=int((len(S)/2-2))
middle2=int((len(S)/2-2))

for i in range(len(S)):
    if S[i] != S1[i]:
        count= count+1
if S[:middle] == S1[:middle2]:
    count1= count1+1

print(count-count1)

Submission status: Wrong Answer

Solution code:
import math
a = input()
b = a
d = "".join(list(reversed(b)))
ans = 0
c = math.floor(len(a)/2)
if len(a) % 2 == 0:
    for i in range(c):
        if not b[i] == d[i]:
            ans += 1
else:
    for i in range(c):
        if not b[i] == d[i+c+1]:
            ans += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
rev = s[::-1]

i=0
count=0
er=[]

while i<len(s):
	if s[i]!=rev[i]:
		if count==0:
			er.append(s[i])
			rev=rev.replace(s[i],rev[i])
			s=s.replace(s[i],rev[i])
			
			count+=1
		else:
			j=0
			while j<len(er):
				if er[j]==s[i]:
					er.append(s[i])
					rev=rev.replace(s[i],rev[i])
					s=s.replace(s[i],rev[i])
					
					count+=1
					break
				j+=1
	i+=1
	
print(count)

Submission status: Wrong Answer

Solution code:
s = list(input())
left = s[: len(s) // 2]
right = s[-1: len(s) // 2: -1]
ans = 0
for i, j in zip(left, right):
    if i == j:
        pass
    else:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
rev = s[::-1]

i=0
count=0
er=[]

while i<len(s):
	if s[i]!=rev[i]:
		if count==0:
			er.append(s[i])
			s=s.replace(s[i],rev[i])
			rev=rev.replace(s[i],rev[i])
			count+=1
		else:
			j=0
			while j<len(er):
				if er[j]==s[i]:
					er.append(s[i])
					s=s.replace(s[i],rev[i])
					rev=rev.replace(s[i],rev[i])
					count+=1
					break
				j+=1
	i+=1
	
print(count)

Submission status: Wrong Answer

Solution code:
A = list(input())
B = round(len(A) / 2)
if len(A) % 2 != 0:
	A.pop(B - 1)
R = 0
C = A[0:B]
D = A[-B:]
D = D[::-1]
count = 0
for i in range(B - 1):
	if C[count] != D[count]:
		R += 1
	count += 1
print(str(R))

Submission status: Wrong Answer

Solution code:
s=input()
rev = s[::-1]

i=0
count=0
er=[]

while i<len(s):
	if s[i]!=rev[i]:
		j=0
		if count==0:
			er.append(s[i])
			s=s.replace(s[i],rev[i])
			count+=1
		else:
			while j<len(er):
				if er[j]==s[i]:
					er.append(s[i])
					s=s.replace(s[i],rev[i])
					count+=1
					break
				j+=1
	i+=1
	
print(count)

Submission status: Wrong Answer

Solution code:
value=input()
value_list=[v for v in value]
value_list_rev=list(reversed(value_list))
cnt=0
for i in range(round(len(value_list)/2)):
	if value_list[i] != value_list_rev[i]:
		cnt=+1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())

half = len(S) // 2

front = list(S[0:half])
back = list(S[len(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:
from sys import stdin
lines = stdin.readlines()
 
S = lines[0]
S0 = len(S)
Sl = list(S)

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)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s=input()
rev = s[::-1]

i=0
count=0
er=[]

while i<len(s):
	if s[i]!=rev[i]:
		j=0
		if count==0:
			er.append(s[i])
			count+=1
		else:
			while j<len(er):
				if er[j]==s[i]:
					er.append(s[i])
					count+=1
					break
				j+=1
	i+=1
	
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
string = list(input())
length = len(string)
l = list()
if length % 2 ==0:
    for i in range (int(length/2),length):
        l.append(string[i])
    l.reverse()
else:
    for i in range (int(length/2)+1,length):
        l.append(string[i])
    l.reverse()
print(str(l))
result = 0
for i in range(len(l)):
    if not l[i] == string[i]:
        result = result + 1
print(result)

Submission status: Wrong Answer

Solution code:
take = 0
str = input()
first, second = str[:len(str)//2],str[(len(str)+1)//2:]
if first == reversed(second):
    print("count")
else:
    for x in range(len(first)):
        if first[x] != second[len(second)-x-1:]:
            take += 1
            print(take)

Submission status: Wrong Answer

Solution code:
import sys

s = input()
if len(s) == 1:
    print(0)
    sys.exit(0)

sb = s[:len(s)//2]
if len(s) % 2 == 1:
    sa = s[len(s)//2+1:]
else:
    sa = s[len(s)//2:]

cnt = 0
for i,b in enumerate(sb):
    if b != sa[i]:
        cnt += 1
print(cnt)