Goldman Sachs interview question

Rotate a string