Cycles · Application: Genome Assembly and de Bruijn Graphs

Lesson 10

Nikolai Chukhin · Alexander S. Kulikov

Programming problem. (Advanced) Write a program that, for a given set of \(n\) strings, finds the shortest string that contains each of the strings in the set as a substring.

  • Input format.  In the first line, the number \(n \leq 30\) is given. Each of the next \(n\) lines contains a string of the set.

  • Output format.  Shortest superstring.

1 point
Public samples
Public sample 1
Input
3
abc
bca
bcd
Expected output
bcabcd