An interesting problem about String

Revision en3, by I_need_7.0_IELTS, 2023-04-08 18:01:51

Statement

Given $$$n$$$ strings. Find the string $$$s$$$ with minimum length such that each of $$$n$$$ given strings is a substring of $$$s$$$.

Constraint

$$$n \le 50$$$

Every of $$$n$$$ strings has length not exceed $$$10$$$

Example:

Input:

3
ab
ba
abb

Output:

abba

This problem is hard for me. Can you give me a hint? Thank you in advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English I_need_7.0_IELTS 2023-04-08 18:01:51 81 Tiny change: 'n <= 50$\nEvery of' -> 'n <= 50$\n\nEvery of'
en2 English I_need_7.0_IELTS 2023-04-08 17:53:56 4 Changed from "minimal" to "minimum". Sorry for my wrong grammar.
en1 English I_need_7.0_IELTS 2023-04-08 17:05:21 344 Initial revision (published)