Pregunta de entrevista de Panasonic

Coding questions, Reverse the string but keep special characters on same place.