Sagility Interview Question

Reverse the words in the given string