问题 A: Super-palindrome
时间限制: 1 Sec 内存限制: 128 MB
提交: 490 解决: 169
[提交] [状态] [命题人:admin]
题目描述
You are given a string that is consisted of lowercase English alphabet. You are supposed to change it into a super-palindrome string in minimum steps. You can change one character in string to another letter per step.
A string is called a super-palindrome string if all its substrings with an odd length are palindrome strings. That is, for a string s, if its substring si...j satisfies j - i + 1 is odd then si+k = sj-k for k = 0,1,...,j-i+1.
输入
The fi rst line contains an integer T (1≤T≤100) representing the number of test cases.
For each test case, the only line contains a string, which consists of only lowercase letters. It is guaranteed that the length of string satisfies 1≤|s|≤100.
输出
For each test case, print one line with an integer refers to the minimum steps to take.
样例输入
复制样例数据