Question: A telegraph operator frequently receives two messages at the same time. Fortunately for the operator, the messages are perfectly interleaved. For example the string gboeoadumtoirfnuilndgasy
A telegraph operator frequently receives two messages at the same time. Fortunately for the operator, the messages are perfectly interleaved. For example the string "gboeoadumtoirfnuilndgasy" contains the phrases "goodmornings" and "beautifulday".
Write a code snippet that reads in a string and splits it into two separate strings. Hint: Refer to the string stride and slicing operations in Section 3.2.
Sample output should look like the following:
The input "gboeoadumtoirfnuilndgasy" produces the following output.
Phrase 1: goodmornings Phrase 2: beautifulday
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
