Given an input string s, reverse the order of the words. A word is a maximal sequence of non-space characters. Collapse multiple spaces and trim leading/trailing spaces so the result has single spaces between words.
Input: A quoted string s.
Output: Quoted string — words in reverse order.
Input: "the sky is blue"
Output: "blue is sky the"
Explanation: Words reversed.Input: " hello world "
Output: "world hello"
Explanation: Trimmed and reversed.Input: "a good example"
Output: "example good a"
Explanation: Spaces collapsed.1<=s.length<=10^4