Skip to content

Latest commit

 

History

History
101 lines (41 loc) · 1.49 KB

File metadata and controls

101 lines (41 loc) · 1.49 KB

中文文档

Description

Given an array A of strings, find any smallest string that contains each string in A as a substring.

We may assume that no string in A is substring of another string in A.

 

Example 1:

Input: ["alex","loves","leetcode"]

Output: "alexlovesleetcode"

Explanation: All permutations of "alex","loves","leetcode" would also be accepted.

Example 2:

Input: ["catg","ctaagt","gcta","ttca","atgcatc"]

Output: "gctaagttcatgcatc"

 

Note:

    <li><code>1 &lt;= A.length &lt;= 12</code></li>
    
    <li><code>1 &lt;= A[i].length &lt;= 20</code></li>
    
 

Solutions

Python3

Java

...