Cycles · Application: Genome Assembly and de Bruijn Graphs
Lesson 10
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.
Public samples
Input
3 abc bca bcd
Expected output
bcabcd