481. Reverse Each Word
EasyString
Reverse the characters of each word while keeping the word order and single spaces.
Input format
One line of words
Output format
The transformed line.
Example 1
Input
Let's take LeetCode contest
Output
s'teL ekat edoCteeL tsetnoc
Example 2
Input
Mr Ding
Output
rM gniD
Constraints
1 ≤ length ≤ 5 × 10⁴
Read input from standard input and print the answer to standard output. Your code is judged against 3 test cases, most of them hidden.
Loading the MyLoginn IDE…