Exercise: Overlapping Removals Yielding Existing Words

Write a program that finds words from which one can remove either and both of two overlapping substrings and the results are existing words, too. Example:

weakhearted
 |---|      → warted
  |-----|   → weed
 |------|   → wed

Solutions

Origin

I needed to construct examples for explaining the transform function in the distributed text editor. Of course, you could use some abcdefg strings, but that would be boring.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s