Reverse the words
Read a line of words and print the words in reverse order, separated by single spaces.
one two three becomes three two one.
Input
one two three
Expected output
three two one
Input
solo
Expected output
solo
Show a hint
Arrays have a reverse() method, and join(" ") turns an array back into a sentence.
Show a solution
Loading the editor…
Run the tests to check your solution.