Pergunta de entrevista da empresa Taboola

Reverse a string without affecting special characters (optimally)