Python3 with tree hash
\nimport collections\nfrom typing import List\nfrom sortedcontainers import SortedDict\n\n\nclass TreeNode:\n    def __init__(self, val):\n        self.val = va
```\nimport collections\nfrom typing import List\nfrom sortedcontainers import SortedDict\n\n\nclass TreeNode:\n    def __init__(self, val):\n        self.val = val\n        self.children = SortedDict()\n\n\nclass Solution:\n    def __init__(self):\n        self.key2Id = {}\n        self.key2Count = collections.defaultdict(int)\n        self.node2Key = {}\n        self.res = []\n\n    def deleteDuplicateFolder(self, paths: List[List[str]]) -> List[List[str]]:\n        root = TreeNode(\'/\')\n        for path in paths:\n            node = root\n            for c in path:\n                if c not in node.children:\n                    node.children[c] = TreeNode(c)\n                node = node.children[c]\n\n        self.get_id(root)\n        self.dfs(root, [])\n\n        return self.res\n\n    def get_id(self, node):\n        if not node:\n            return 0\n        key = \'\'\n        for child in node.children.values():\n            key += str(self.get_id(child)) + \'#\' + child.val + \'#\'\n\n        self.node2Key[node] = key\n        self.key2Count[key] += 1\n        if self.key2Count[key] == 1:\n            self.key2Id[key] = len(self.key2Id) + 1\n\n        return self.key2Id[key]\n\n    def dfs(self, node, path):\n        key = self.node2Key[node]\n        if self.key2Count[key] >= 2 and key != \'\':\n            return\n        if node.val != \'/\':\n            path.append(node.val)\n            self.res.append(path.copy())\n\n        for child in node.children.values():\n            self.dfs(child, path.copy())\n\n        if node.val != \'/\':\n            path.pop()\n\n\nif __name__ == \'__main__\':\n    s = Solution()\n    # print(s.deleteDuplicateFolder([["a"], ["c"], ["d"], ["a", "b"], ["c", "b"], ["d", "a"]]))\n    print(s.deleteDuplicateFolder(\n        [["b"], ["f"], ["f", "r"], ["f", "r", "g"], ["f", "r", "g", "c"], ["f", "r", "g", "c", "r"], ["f", "o"],\n         ["f", "o", "x"], ["f", "o", "x", "t"], ["f", "o", "x", "d"], ["f", "o", "l"], ["l"], ["l", "q"], ["c"], ["h"],\n         ["h", "t"], ["h", "o"], ["h", "o", "d"], ["h", "o", "t"]]\n        ))\n```
['Python3']