Tech Mahindra interview question

Reverse the array in string