string to palindrome, C/C++ Programming

Assignment Help:


A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindromes with minimum number of character replacements.

Input Format:

First line starts with T, which is the number of test cases. Each test case contains a string (S).

Output Format:

For each test case print the minimum number of character replacements needed to convert the given string to palindrome.

Constraints:

1<=T<=100

1<=|S|<=60, S will contains only lower case alphabets (''a''-''z'')

Sample Input and Output

SNo. Input Output
1
2
saarj
saaaa


2
1

Related Discussions:- string to palindrome

C program to print l diagonal triangle, C program to print L diagonal trian...

C program to print L diagonal triangle: void main() {                 int i=0,j=0;                 int arr[rows][cols];                 for (i=0; i

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Explain function templates, Function Templates Function templates give ...

Function Templates Function templates give you with the capability to write a one function that is a skeleton, or template, for a family of similar functions. In function ov

C Program with android, Hello, I would like to know if you can help in C pr...

Hello, I would like to know if you can help in C programs that work on android.

201 it, overload assignment opertor to assign the data of one object to ant...

overload assignment opertor to assign the data of one object to anthor

Luminous and jewels, Byteland county is very famous for luminous jewels. Lu...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Advantages to the use of functions, Question: (a) What is a function? A...

Question: (a) What is a function? Are functions needed when writing a C program? (b) State one of the advantages to the use of functions. (c) What do you meant by underst

Last ant on rod, There are ''n'' ants on a ''n+1'' length rod. The ants are...

There are ''n'' ants on a ''n+1'' length rod. The ants are numbered from 1 to n and are initially placed at positions starting from position 1 till position n. They are moving eith

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd