Given a string s of words separated by single spaces, reverse the characters of each word while keeping the words in their original order and the spaces in place. Return the resulting string.
Given a string s of words separated by single spaces, reverse the characters of each word while keeping the words in their original order and the spaces in place. Return the resulting string.
Example 1:
Input: {"s":"Let's take LeetCode contest"}
Output: s'teL ekat edoCteeL tsetnoc
Constraints:
1≤s.length≤5×104
s contains printable ASCII characters.
s has no leading or trailing spaces.
s has at least one word, and words are separated by a single space.
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"s":"Let's take LeetCode contest"}
Copy s into a mutable array of 27 characters. It has 4 words, and start = 0 points at the first one.