Pregunta de entrevista de Bloomberg

How to reverse a string

Respuestas de entrevistas

Anónimo

31 de ene de 2012

using two pointers, and the first pointing to the beginning, and the other pointing to the end, and both move to the middle, and do the swapping in the meantime.

1

Anónimo

20 de dic de 2015

Java: return new StringBuilder(inputString).reverse().toString(); C++: return string(inputString.rbegin(), inputString.rend());