Practice solution: Compress the spaces in a given sentence and reverse the sentence keeping the words intact.