Problem 1181 · Medium

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.

Open the interactive visualisation