Python AC concise solution ~132 ms
First, we analyze connections between any two string(a, b) in A:\n\t We get l, longest length of b that a ends with. \n\t In merged[a] array, we will have b str
* First, we analyze connections between any two string(a, b) in A:\n\t* We get l, longest length of b that a ends with. \n\t* In merged[a] array, we will have b strings and longest length in the zero index.\n* We define worst possible res(ult) as "".join(A) where every string in A appended and store it in array for global acces through DFS.\n* In DFS, there are 3 variables => current superstring, current string, set of left strings\n\t* While doing DFS if length of superstring + left strings(can be empty) < length of res, we update res.\n\t* If there are any new b in the set for current string, we do DFS for new b\'s in merged[s].\n\t* Else, that means we got stuck with set of strings that are independent from current string.\n\t\t* In that case, every left string in the set can be next string and we do DFS for b\' in merged[next string].\n* Finally we return updated res[0] after all DFS\'s.\n* Upvote if you like the solution. Thanks!\n```\nclass Solution:\n    def shortestSuperstring(self, A):\n        def merge(a, b):\n            for i in range(len(b), 0, -1):\n                if a.endswith(b[:i]):\n                    return i\n            return 0\n        def dfs(sup, s, st):\n            if len(sup + "".join(st)) < len(res[0]):\n                res[0] = sup + "".join(st)\n            if st and any(new in st for new in merged[s][1:]):\n                for new in merged[s][1:]:\n                    if new in st:\n                        dfs(sup + new[merged[s][0]:], new, st - {new})\n            else:\n                for nex in st:\n                    for new in merged[nex][1:]:\n                        if new in st:\n                            dfs(sup + nex + new[merged[nex][0]:], new, st - {nex, new})\n        merged, res = {}, ["".join(A)]\n        for a, b in itertools.combinations(A, 2):\n            for a, b in ((a, b), (b, a)):\n                l = merge(a, b)\n                if a not in merged or l > merged[a][0]:\n                    merged[a] = [l, b]\n                elif l == merged[a][0]:\n                    merged[a].append(b)\n        for a in A:\n            dfs(a, a, set(A) - {a})\n        return res[0]\n```
[]