错误解释
CompileError!
编译信息
main.cpp: In function \xe2\x80\x98TreeNode* buildTree(const std::unordered_map<int, std::pair<int, char> >&)\xe2\x80\x99:\nmain.cpp:40:5: error: \xe2\x80\x98unordered_set\xe2\x80\x99 was not declared in this scope\n 40 | unordered_set<int> childNodes;\n | ^~~~~~~~~~~~~\nmain.cpp:5:1: note: \xe2\x80\x98std::unordered_set\xe2\x80\x99 is defined in header \xe2\x80\x98<unordered_set>\xe2\x80\x99; did you forget to \xe2\x80\x98#include <unordered_set>\xe2\x80\x99?\n 4 | #include <unordered_map>\n +++ |+#include <unordered_set>\n 5 | \nmain.cpp:40:19: error: expected primary-expression before \xe2\x80\x98int\xe2\x80\x99\n 40 | unordered_set<int> childNodes;\n | ^~~\nmain.cpp:42:9: error: \xe2\x80\x98childNodes\xe2\x80\x99 was not declared in this scope\n 42 | childNodes.insert(edge.second.first);\n | ^~~~~~~~~~\nmain.cpp:46:13: error: \xe2\x80\x98childNodes\xe2\x80\x99 was not declared in this scope\n 46 | if (childNodes.find(node.first) == childNodes.end()) {\n | ^~~~~~~~~~\n