Amazon interview question

Revert word sequences in a string