Pregunta de entrevista de Tata Consultancy Services

Sort the array and interchange the second last and second letter.