Amazon interview question

Leet code question: rotate string