Pergunta de entrevista da empresa Citicapital Commercial Corp

How to reverse a string in most optimised way??