Problem 2800 · Medium

Shortest String That Contains Three Strings

Try all six orders of the three strings, merging neighbors with their largest overlap, and keep the shortest result.

Open the interactive visualisation