Question d’entretien chez Zendesk

Reverse String

Réponses aux questions d'entretien

Utilisateur anonyme

2 févr. 2015

Quick way to reverse a string: walk through the array from each end and swap the characters until you meet in the middle. O(n) time and doesn't require additional storage since its in place.

4

Utilisateur anonyme

6 févr. 2019

def my_cool_reverse_function(str) str.reverse end my_cool_reverse_function('why rewrite the wheel?')