python dfs + trie + hasmap
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def deleteDuplicateFolder(self, paths: List[List[str]]) -> List[List[str]]:\n        \n\n        trie = {}\n\n        def insert(s):\n            current = trie\n            for i in s:\n                current = current.setdefault(i, {"#":False})\n            \n        \n        for p in paths:\n            insert(p)\n        table = {}\n        def dfs(root):\n            if  len(root) == 1 and "#" in root:\n                return [""]\n            ans = []\n            for k in root:\n                if k == "#":\n                    continue\n                path = dfs(root[k])\n                for p in path:\n                    ans.append(k+p)\n\n            ans.sort()\n            s="-".join(ans)\n            if s not in table:\n                table[s]=[]\n            table[s].append(root)\n            return ans\n\n\n        path = dfs(trie)\n        path.sort()\n        table.pop("-".join(path))\n        for s in table:\n            if len(table[s]) > 1:\n                for node in table[s]:\n                    node["#"] = True\n        \n\n        ans = []\n        def construct(root, p):\n            if "#" in root and root["#"] == True:\n                return\n            if  len(root) == 1 and "#" in root:\n                ans.append(p)\n                return\n            if p:\n                ans.append(p)\n            for k in root:\n                if k == "#":\n                    continue\n                construct(root[k], p+[k])\n         \n            \n\n        construct(trie, [])\n        return ans\n       \n\n\n```
['Hash Table', 'Depth-First Search', 'Trie', 'Python3']