Reverse the words
Reverse the order of the words in a sentence. The letters inside each word stay as they are. Separate the words with single spaces.
Reported in: Wipro Elite NTH, Accenture, HCLTech (memory-based)
Input
One line: the sentence.
Output
The words in reverse order.
Constraints
1 ≤ length ≤ 10^5.
Example 1
Input:
placements are coming soon
Output:
soon coming are placementsExample 2
Input:
hello
Output:
helloHint: Split on spaces, reverse the list, join with one space.