Infosys interview question

Sorting question, string palindrome problem