Solve reverse words in string