Reverse a string preserving space positions

4

1 votes
Easy-Medium
Problem

Write a program to Reverse the given string while preserving the position of spaces.

INPUT: First Line Test Case T. second Line String.

Output: Reverse String.

Sample Input
2
abc de
Help others
Sample Output
edc ba
sreh topleH
Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?