Problem 3571 · Medium

Find the Shortest Superstring II

Two words can be chained in either order, sharing whatever overlap their ends allow; the shortest chain wins, with ties broken alphabetically.

Open the interactive visualisation