Hashing+dfs
\nclass Solution:\n    def deleteDuplicateFolder(self, paths: List[List[str]]) -> List[List[str]]:\n        prime=1000000000+7\n        class node:\n           
```\nclass Solution:\n    def deleteDuplicateFolder(self, paths: List[List[str]]) -> List[List[str]]:\n        prime=1000000000+7\n        class node:\n            def __init__(self,val):\n                self.val=val\n                self.childs={}\n                self.hash=0\n        aa=[]\n        for l in paths:\n            for i in l:\n                aa.append(i)\n        aa=list(set(aa))\n        d={}\n        for i in range(len(aa)):\n            d[aa[i]]=i+1\n        temp=[]\n        for p in paths:\n            a=[]\n            for i in p:\n                a.append(d[i])\n            temp.append(a)\n        paths=temp\n        def addChild(root,p,i):\n            if i==len(p):\n                return\n            if p[i] not in root.childs:\n                root.childs[p[i]]=node(p[i])\n            addChild(root.childs[p[i]],p,i+1)\n        tree=node(prime-1)\n        for p in paths:\n            addChild(tree,p,0)\n        \n        freq={}\n        def dfs(root):\n            val=0\n            m=1\n            for child in sorted(root.childs.keys()):\n                if root.childs[child]!=None:\n                    val=(val+(dfs(root.childs[child])*m%prime))%prime\n                m*=2\n            val=(val*(len(aa)+1))%prime\n            if val not in freq:\n                freq[val]=0\n            freq[val]+=1\n            root.hash=val\n            return val+root.val\n        res=[]\n        ans=[]\n        dfs(tree)\n        def dfs2(root,curr):\n            curr.append(root.val)\n            if (freq[root.hash]==1) or len(root.childs)==0:\n                res.append(list(curr))\n            else:\n                curr.pop()\n                return\n            for child in sorted(root.childs.keys()):\n                if root.childs[child]!=None:\n                    dfs2(root.childs[child],curr)\n            curr.pop()\n        ll=[]\n        dfs2(tree,ll)\n        for a in res:\n            tmp=[]\n            for i in a:\n                if i==prime-1:\n                    continue\n                tmp.append(aa[i-1])\n            if tmp:\n                ans.append(tmp)\n            \n        return ans\n            \n```
[]