Genesys interview question

reverse the string