Reverse the order of words in the string. Extra spaces should be removed.
Example 1
Input: s = " hello world "
Output: "world hello"
Explanation: Leading, trailing, and extra spaces between words are normalized.
Output: "world hello"
Explanation: Leading, trailing, and extra spaces between words are normalized.
Example 2
Input: s = "the sky is blue"
Output: "blue is sky the"
Explanation: Words are swapped and extra spaces are removed.
Output: "blue is sky the"
Explanation: Words are swapped and extra spaces are removed.