Python Implementation using concept of Trie
\nclass TrieNode:\n    def __init__(self):\n        self.children = defaultdict(TrieNode)\n        self.hash, self.isDeleted = \'\', False\n        \n    def ad
```\nclass TrieNode:\n    def __init__(self):\n        self.children = defaultdict(TrieNode)\n        self.hash, self.isDeleted = \'\', False\n        \n    def add(self, path, idx = 0):\n        if idx != len(path):\n            self.children[path[idx]].add(path, idx + 1)\n    \n    def calculateHash(self, hashes, nodeName = \'root\'):\n        for childNodeName, childNode in sorted(self.children.items()):\n            self.hash += f\'{childNode.calculateHash(hashes, childNodeName)}+\'\n        if self.hash:\n            hashes[self.hash].append(self)\n        return f\'{nodeName}({self.hash})\'\n    \n    def toList(self, lst, path = []):\n        for childNodeName, childNode in self.children.items():\n            if not childNode.isDeleted:\n                lst.append(path + [childNodeName])\n                childNode.toList(lst, path + [childNodeName])\n\nclass Solution:\n    def deleteDuplicateFolder(self, paths: List[List[str]]) -> List[List[str]]:\n        root, hashToNodes, res = TrieNode(), defaultdict(list), []\n        for path in paths:\n            root.add(path)\n        root.calculateHash(hashToNodes)\n        for nodes in hashToNodes.values():\n            if len(nodes) > 1:\n                for node in nodes:\n                    node.isDeleted = True\n        root.toList(res)\n        return res\n```
['Tree', 'Depth-First Search', 'Trie', 'Recursion', 'Python']