Incedo interview question

code for reversing a string