Before and After Puzzle
Check every ordered pair of phrases: when the last word of one matches the first word of the other, merge them once and keep the distinct results.
Check every ordered pair of phrases: when the last word of one matches the first word of the other, merge them once and keep the distinct results.