Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
Example input and
In pseudo code:
reverse input string reverse each word (you will need to find word boundaries)