reverse the string solution