Question d’entretien chez Bloomberg

How to reverse a string

Réponses aux questions d'entretien

Utilisateur anonyme

31 janv. 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

Utilisateur anonyme

20 déc. 2015

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