Reverse Words in a String III Problem
Reverse Words in a String III Problem — ExecCode School DSA Practice
Solve the Reverse Words in a String III problem on ExecCode. Free online school DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.
Problem description
You are given a sentence with multiple words. Your task is to reverse the letters within each individual word. However, you must keep the words in their original order in the sentence, and also keep any spaces exactly as they are. Print the new sentence.
Examples
Input Let's take LeetCode contest; Output s'teL ekat edoCteeL tsetnoc. Input God Ding; Output doG gniD
Constraints
1 <= n <= 10^5
Practice Reverse Words in a String III free on ExecCode. Browse DSA problems, topic map, and placement guides.