Flip the Address Line Order
Intermediate SolvedAn address feed lists name parts in the wrong order for the target system, which expects them reversed. Reorder the words while keeping single spaces between them.
Implement `solve(String sentence)` (space-separated words) to return the words in reverse order, single-space separated.
Examples
Input
"the quick brown fox"Output
"fox brown quick the"Input
"one two"Output
"two one"Hints
- split(' ') gives a List; collect from last index to first, then String.join.
Tests
Your code runs in a secure sandbox against multiple hidden test cases. The problem is solved only when every test passes. Each run is isolated and any data changes are rolled back automatically.