What is the link between the following words:

beaned, dotted, granted, herbal, homered, jackal, leeward, royal, patron, victim, Victorian

Every word can be split in two parts that are each a first name: Bea and Ned, Dot and Ted, …

Assignment

Write a function nameword to which a word (string) and a collection of first names (strings) must be given. Every first name consist of an uppercase letter, followed by zero or more lowercase letters. If the word can be composed of two first names of the given collection (regardless of the use of uppercase and lowercase letters in the word), the function must print a string with both first names, separated by a hyphen. The first names should both start with an uppercase letter, followed by a sequence of lowercase letters. If the word can not be composed with two first names from the collection, the function must print an empty string.

Note: If there are multiple ways the given word can be composed of first names from the given collection, the function must print the combination of which the first name is the shortest.

Example

>>> firstnames = {'Vic', 'Ian', 'Pat', 'Ron', 'Roy', 'Al', 'Tim', 'Jack'}
>>> nameword('patron', firstnames)
'Pat-Ron'
>>> nameword('Victorian', firstnames)
''
>>> nameword('victim', firstnames)
'Vic-Tim'
>>> nameword('JACKAL', firstnames)
'Jack-Al'
>>> nameword('royal', firstnames)
'Roy-Al'
>>> nameword('herbal', firstnames)
''