본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 25630번 팰린드롬 소떡소떡

by 현장 2022. 10. 23.

-Code

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