#C2207. Minimum Operations to Convert a String into a Palindrome

    ID: 45498 Type: Default 1000ms 256MiB

Minimum Operations to Convert a String into a Palindrome

Minimum Operations to Convert a String into a Palindrome

You are given a string s. In one operation, you can choose any single character in the string and change it to any other character. Determine the minimum number of operations required to convert the given string into a palindrome.

A string is a palindrome if it reads the same forward and backward. For example, "racecar" is a palindrome while "ab" is not.

Note: Only modifications are allowed; you cannot rearrange the letters.

inputFormat

The input is read from standard input (stdin) and is structured as follows:

  1. An integer t that denotes the number of test cases.
  2. Followed by t lines, each containing a single string s.

outputFormat

For each test case, output the minimum number of operations required to convert the given string into a palindrome on a new line to standard output (stdout).

## sample
3
a
ab
racecar
0

1 0

</p>