Question d’entretien chez Amazon

String reversal in place

Réponse à la question d'entretien

Utilisateur anonyme

8 oct. 2010

Assume that s is the string. Here is a C++ like solution: end= s.length()-1; first=0; While (first <= end) { t=s[first]; s[first] = s[end]; s[end] = t; first++; end— }

1