Statement
Given $$$n$$$ strings. Find the string $$$s$$$ with minimal length such that each of $$$n$$$ given strings is a substring of $$$s$$$.
Example:
Input:
3
ab
ba
abb
Output:
abba
This problem is hard for me. Can you give me a hint? Thank you in advance.