CT21669

Weaver and the Ruby banners

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Weaver found an old ledger of banners in the studio attic at the alabaster quarry of Whitestone. The margin notes pose a precise question. Task: Read a line of space-separated words and print the words in reverse order. Input format: One line with words separated by single spaces. Output format: Print the words in reverse order, single-spaced. Constraints: 1 <= |s| <= 1891; s contains lowercase English letters.

Example 1:

Input: fdqegyi
Output: fdqegyi

Example 2:

Input: twrggyyxcghe ktyzkizrmt fgygfssrq ipzfpw ioehovdxnzza inspccq kqgdqwgowlcx s ffrejdqasz vpvwairjhu
Output: vpvwairjhu ffrejdqasz s kqgdqwgowlcx inspccq ioehovdxnzza ipzfpw fgygfssrq ktyzkizrmt twrggyyxcghe

Example 3:

Input: rprxhmr bfunh klgdxk dflh u o ieczvquu hegrdk
Output: hegrdk ieczvquu o u dflh klgdxk bfunh rprxhmr

Constraints:

1 <= |s| <= 1891; s contains lowercase English letters.

Loading...
Test Cases:No test cases
No test cases available.
Weaver and the Ruby banners - EASY Coding Problem | CodeTikki