Question: Given a string as input, you have to reverse the string by keeping the punctuation and spaces intact, i.e., the position of the punctuation and
Given a string as input, you have to reverse the string by keeping the punctuation and spaces intact, i.e., the position of the punctuation and spaces should not change even after reversing, but the positions of characters, numbers will change after reversing. You have to modify the source string itself without creating another string.
Input:
A single line contains the input line
Output:
A single line in reversed order keeping the punctuation and spaces intact.
Constraint:
0 Sample Test Case 1: Input: see this -> check 1.punctuations and 2:space position. Output: noi tiso -> pecap s.2dnasnoitaut cnu p:1kceh csihtees.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
