Pregunta de entrevista de Taboola

Reverse a string without affecting special characters (optimally)