2016 North American Practice Contest 2


2016-10-02 19:00 CEST

2016 North American Practice Contest 2


2016-10-03 00:00 CEST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -532 days 23:11:34

Time elapsed


Time remaining


Problem F
Palindrome Names

Image by Eviatar Bach.

Anna and Bob are having a baby. They both enjoy the advantage of having palindrome names, meaning that their names are spelled the same way forwards and backwards. Wanting to be good parents, they decide to give their child a palindrome name too. The only problem is that they aren’t sure if the one they picked is a palindrome. If it turns out it isn’t a palindrome, they want to change it to a palindrome using as few changes as possible. The allowed changes are:

  • Change one letter of the name.

  • Add a letter to the end of the name.

Help Bob and Anna find out how many changes they need to make to the name to make it a palindrome.


Input is the name they have chosen.


Output the number of changes they need to make.


  • The length of the name is at least $1$ and at most $100$ characters.

  • The name consists of only lowercase letters a–z.

Sample Input 1 Sample Output 1
Sample Input 2 Sample Output 2