Problem #11
Overlap
A linear crossword of length L is a string of L lowercase alphabetic characters arranged in a line. The characters in the line consist of overlapping words. For example, the following list characters
a n d a t a r e a l l a s t a s k
was made from the following words:
all, an, and, are, area, as, ask, at, data, last, or, read, real, task
To make the list of characters, the first word is simply inserted. All other words used must overlap another work by at least one letter. Not all of the words were used to make the list, since only the first word inserted can not overlap another word and not all words will be able to overlap another word.
Write a program that, given a list of at least 5 words and up to 10 words, produces a linear crossword.
Note: There are many ways to solve this problem. One correct solution may produce a completely different linear crossword than another correct solution, even using the same words entered in the same order.