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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!