[python] dfs with trie
\nclass Solution:\n    def deleteDuplicateFolder(self, paths: List[List[str]]) -> List[List[str]]:\n        tr={"1":"*"}\n        for p in paths:\n            c
```\nclass Solution:\n    def deleteDuplicateFolder(self, paths: List[List[str]]) -> List[List[str]]:\n        tr={"1":"*"}\n        for p in paths:\n            ctr=tr\n            for f in p:\n                if f not in ctr:\n                    ctr[f]={"1":f}  \n                ctr=ctr[f]\n        hm=defaultdict(list)\n        def dfs(p,n):\n            if not n:return ""\n            h,i=[],0\n            for k in sorted(n.keys()):\n                if k!="1":\n                    h.append(f\'{dfs(n,n[k])}{i}\')\n                    i+=1\n            h="".join(h)\n            hm[h].append((p,n["1"]))\n            return h+n["1"]\n        \n        dfs({},tr)\n        del hm[""]\n        for x in hm:\n            if len(hm[x])>1:\n                for p,f in hm[x]:del p[f]\n        res=[]\n        def dfs2(n,p):\n            if not n:return\n            res.append(p)\n            for k in n:\n                if k!="1":dfs2(n[k],p+[k])\n                    \n        dfs2(tr,[])\n        return res[1:]\n```
[]