Beats 100% by 100ms, actuall hashing, clean code solution
Intuition\nThe trick is to simply hash the directory structure, but without taking into account the current node name.\n\n# Approach\nSimple hash combine, with 
# Intuition\nThe trick is to simply hash the directory structure, but without taking into account the current node name.\n\n# Approach\nSimple hash combine, with a tree structure. I don\'t actually spend time cleaning up the tree, just marking that they are removed.\n\nThere could of course be false positives here, but the chances are very very small, so I\'m fine with it for leetcode. You could create a second function which actually compares the children, if you wanted.\n\n# Complexity\n- Time complexity: Don\'t Know\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$\n\n\n# Code\n```\ntemplate <class T> inline void hash_combine(std::size_t& seed, const T& v) {\n    std::hash<T> hasher;\n    seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);\n}\n\n\ninline const auto optimize = []() {\n  std::ios::sync_with_stdio(false);\n  std::cin.tie(nullptr);\n  std::cout.tie(nullptr);\n  return 0;\n}();\n\n\n\nclass Solution {\n    struct Node {\n        std::string_view name;\n        std::map<std::string_view, std::unique_ptr<Node>> children;\n        bool marked{false};\n\n        std::size_t\n        hash(std::unordered_map<std::size_t, std::vector<Node*>>& dir) {\n            if (children.size() == 0)\n                return 0;\n\n            // This does NOT include the hash of the name, since we are\n            // interested in child hashes.\n            std::size_t ourHash = 0;\n            for (const auto& child : children) {\n                hash_combine(ourHash, child.first);\n                auto theirHash = child.second->hash(dir);\n                hash_combine(ourHash, theirHash);\n            }\n\n            dir[ourHash].emplace_back(this);\n            return ourHash;\n        }\n\n        void pushOut(std::vector<std::vector<std::string>>& dirs,\n                     std::vector<std::string>& cur) {\n            if (marked)\n                return;\n\n            if (name != "/")\n                dirs.push_back(cur);\n\n            for (const auto& [cName, child] : children) {\n                cur.emplace_back(cName);\n                child->pushOut(dirs, cur);\n                cur.pop_back();\n            }\n        }\n    };\n\npublic:\n    static std::vector<std::vector<std::string>>\n    deleteDuplicateFolder(const std::vector<std::vector<std::string>>& paths) {\n        Node root{"/"sv};\n\n        for (const auto& path : paths) {\n            Node* cur = &root;\n            for (const auto& dir : path) {\n                if (auto it = cur->children.find(dir);\n                    it != cur->children.end()) {\n                    cur = it->second.get();\n                    continue;\n                }\n\n                auto newNode = std::make_unique<Node>(dir);\n                auto hey = newNode.get();\n                cur->children.emplace(dir, std::move(newNode));\n                cur = hey;\n            }\n        }\n\n        // now we just need to\n        std::unordered_map<std::size_t, std::vector<Node*>> groups;\n        root.hash(groups);\n\n        for (const auto& [hash, group] : groups) {\n            if (group.size() < 2)\n                continue;\n\n            for (const auto& node : group)\n                node->marked = true;\n        }\n\n        std::vector<std::vector<std::string>> out;\n        std::vector<std::string> tmp;\n        root.pushOut(out, tmp);\n        return out;\n    }\n};\n```
['Hash Table', 'Trie', 'Hash Function', 'C++']