Sagility interview question

Reverse the words in the given string