Infosys Interview Question

Sorting question, string palindrome problem