Reverse Words in a Sentence
Easyjavapythonccppjavascript
Given a sentence, reverse the order of its words without reversing the characters inside each word.
Input Format
A single line containing words separated by single spaces, with no leading or trailing spaces.
Output Format
Print the sentence with its words in reverse order, separated by single spaces.
Example 1
Input
I love coding
Output
coding love I
Explanation: Only the order of the words changes.
- 1 <= length of S <= 100000
- Words are separated by exactly one space.