[C++] Trie + DFS hashing
\nclass TrieNode {\npublic:\n    map<string, TrieNode*> children;\n    bool isEnd;\n    bool isExcluded;\n    string name;\n    TrieNode(string folder) {\n     
```\nclass TrieNode {\npublic:\n    map<string, TrieNode*> children;\n    bool isEnd;\n    bool isExcluded;\n    string name;\n    TrieNode(string folder) {\n        name = folder;\n        isEnd = false;\n        isExcluded = false;\n    }\n};\nclass Trie {\npublic:\n    TrieNode* root;\n    Trie() {\n        root = new TrieNode("/");\n    }\n    void insert(vector<string>& path) {\n        int n = path.size();\n        TrieNode* curr = root;\n        for (int i = 0; i < n; i++) {\n            if (curr->children.find(path[i]) == curr->children.end()) {\n                curr->children[path[i]] = new TrieNode(path[i]);\n            }\n            curr = curr->children[path[i]];\n        }\n        curr->isEnd = true;\n    }\n    void findDuplicate(unordered_map<string, vector<TrieNode*>>& mp) {\n        hashAndStore(root, mp);\n    }\n    string hashAndStore(TrieNode* node, unordered_map<string, vector<TrieNode*>>& mp) {\n        string curr = "";\n        for (auto child : node->children) {\n            curr += hashAndStore(child.second, mp);\n            curr.push_back(\'|\');\n        }\n        if (curr != "") mp[curr].push_back(node);\n        return node->name + "|" + curr;\n    }\n    void markDuplicate(unordered_map<string, vector<TrieNode*>>& mp) {\n        for (auto element : mp) {\n            if (element.second.size() > 1) {\n                for (auto node : element.second) {\n                    node->isExcluded = true;\n                }\n            }\n        }\n    }\n    void getNotDuplicate(vector<vector<string>>& ans, vector<string>& path) {\n        _getNotDuplicate(root, ans, path);\n    }\n    void _getNotDuplicate(TrieNode* node, vector<vector<string>>& ans, vector<string>& path) {\n        if (node->isExcluded) return;\n        if (node->isEnd) ans.push_back(path);\n        for (auto child : node->children) {\n            path.push_back(child.second->name);\n            _getNotDuplicate(child.second, ans, path);\n            path.pop_back();\n        }\n    }\n};\nclass Solution {\npublic:\n    vector<vector<string>> deleteDuplicateFolder(vector<vector<string>>& paths) {\n        Trie* trie = new Trie();\n        for (auto path : paths) trie->insert(path);\n        \n        unordered_map<string, vector<TrieNode*>> mp;\n        trie->findDuplicate(mp);\n        trie->markDuplicate(mp);\n        \n        vector<vector<string>> ans;\n        vector<string> path;\n        trie->getNotDuplicate(ans, path);\n        return ans;\n    }\n};\n```
['Depth-First Search', 'Trie', 'C']