Python DP solution
\nclass Solution:\n    def shortestSuperstring(self, A: List[str]) -> str:\n        \n        def overlap_length(a, b):\n            for i in range(1, len(a)):\
```\nclass Solution:\n    def shortestSuperstring(self, A: List[str]) -> str:\n        \n        def overlap_length(a, b):\n            for i in range(1, len(a)):\n                aa = a[i:]\n                ll = len(aa)\n                bb = b[:ll]\n                if aa == bb:\n                    return ll\n            return 0\n        \n        N = len(A)\n        \n        g = collections.defaultdict(list)\n        for i in range(N):\n            for j in range(N):\n                if i == j: continue\n                g[i].append([j, overlap_length(A[i], A[j])])\n\n        ret = \'a\' * (12 * 20 + 1)\n        \n        @functools.lru_cache(None)\n        def dfs(idx, mask):\n            nonlocal ret\n            if mask == 2 ** N - 1:\n                return A[idx]            \n            \n            # Shortest of all possible strings\n`            s = \'a\' * (12 * 20 + 1)\n            for neigh, ovlp in g[idx]:\n                if mask & (1 << neigh):\n                    continue\n                s2 = dfs(neigh, mask | (1 << neigh))\n                if len(s2) + len(A[idx]) - ovlp < len(s):\n                    s = A[idx][:len(A[idx])-ovlp] + s2\n            return s\n\n        for i in range(N):\n            cur = dfs(i, 0 | (1 << i))\n            if len(cur) < len(ret):\n                ret = cur\n        \n        return ret\n```
[]