Problems > Mirror Each Word

Mirror Each Word

Difficulty: 900 2000 ms 128 MB

strings

Reverse every word individually, keeping the word order.

Input: one line with words separated by single spaces.

Output: each word reversed, order unchanged.

Constraints:

  • 1 to 200 words of lowercase letters

Sample Tests

Input 1
abc def
Output 1
cba fed
Input 2
a bc
Output 2
a cb

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.