[C++] Super Short Solution !!!
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> smallestMissingValueSubtree(vector<int>& p, vector<int>& n) {\n        int N = n.size();\n        vector<int> res(N, 1);\n        vector<vector<int>> child(N, vector<int>());\n        for(int i = 0; i < N; i++) if(p[i] != -1) child[p[i]].push_back(i);\n        auto pos = find(begin(n), end(n), 1)-begin(n);\n        bool seen[10000001]{};\n        std::function<void(const int&)>dfs;\n        dfs = [&](const int& r) {\n            if(!seen[n[r]]) {\n                seen[n[r]] = true;\n                for(auto nxt : child[r]) dfs(nxt);\n            }\n        };\n        int missing = 2;\n        for(int t = pos; pos < N && t != -1; t = p[t]) {\n            dfs(t);\n            while(seen[missing]) missing++;\n            res[t] = missing;\n        }\n        return res;\n    }\n};\n```
['C++']