654. Reverse Words in a String
Given a string input, the task is to reverse the order of the words in the string. Multiple spaces should be replaced with a single space.
The input should be a line containing multiple words.
The output should be the string with the words in reversed order.
Input: the sky is blue
Output: blue is sky the
The length of the input string should not exceed 10^4.