73. Reverse a String In-Place

You are given a null-terminated string (maximum 100 characters). Your task is to reverse the string in-place without using any additional array or library functions like strrev().

You must swap characters from both ends until the string is reversed. The null-terminator must remain at the end.

Example-1

Input: "firmware"
Output: erawmrif


Example-2

Input: "abc 123"
Output: 321 cba


Example-3

Input: ""
Output: ``


 

Loading...

Input

firmware

Expected Output

erawmrif