#2671. 回文串
回文串
Description
如果一个字符串,顺读与倒读的内容一样,称这个字符串为回文。例如 aka
是一个回文,noon
也是一个回文。
给定一个字符串,请计算最少需要修改多少个字符,才能将这个字符串变成回文。
单次修改可以将字符串中某一个位置上的字符变成任意一个其他字符。
Input Format
一列字符:保证字符仅由小写拉丁字母构成。Output Format
单个整数:表示最少需要多少次修改才能将输入字符串变成回文。abbc
1
Hint
样例1说明:
将c修改成a
输入:
aaa
输出:
0
说明:
不需要修改
设字符串的长度为 <math xmlns="http://www.w3.org/1998/Math/MathML">n
- <math xmlns="http://www.w3.org/1998/Math/MathML">50% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1≤n≤1,000
- <math xmlns="http://www.w3.org/1998/Math/MathML">100% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1≤n≤1,000,000