I've been using a library called Djangular recently, which integrates Django and Angular.
After a while I thought 'Wouldn't it be fun to programmatically generate portmanteau?'
Here are some examples (e.g. testcases):
Django + Angular -> Djangular
Camel + Leopard -> Cameleopard
Spoon + Fork -> Spoork
Ham + Hammer -> Hammer
The general rule is to find the first common letter working backwards on first word, and working forwards on the last word. Not all portmanteau can be found this way though...
I've deliberately picked 'simple' ones to generate (for instance we're ignoring things like Zebra + Donkey = Zedonk, which is too arbitrary to generate programmatically - the correct behaviour).
Ties can be resolved eitherway - suppose you have
cart + ante - both
carte, (since t is the last common letter in the first word) and
cante, (since a is the first common letter of the last word) are value.
Unfun loopholes are not allowed (including pulling 'solved' examples off wikipedia)
This is code golf, so shortest answer wins. I'll pick the winner a month from posting. Please post the output for all your code.