Pregunta de entrevista de TeamViewer

I was asked to reverse a String