C++ Simple DFS On Binary Tree
\nclass Solution {\npublic:\n    long long N;\n    long long maxi;\n    long long count;\n    int dfs(vector<vector<int>>& g, int src){\n        \n        int l
```\nclass Solution {\npublic:\n    long long N;\n    long long maxi;\n    long long count;\n    int dfs(vector<vector<int>>& g, int src){\n        \n        int l = 0,r = 0;\n        \n        if(g[src].size() > 0){\n            l = dfs(g,g[src][0]);\n        }\n        \n        if(g[src].size() > 1){\n            r = dfs(g,g[src][1]);\n        }\n        \n        long long res = 1;\n        \n        if(l)res *= l;\n        if(r)res *= r;\n        \n        long long left = N-(l+r)-1;\n        \n        if(left)res *= left;\n        if(maxi < res){\n            count=1;\n            maxi=res;\n        }\n        \n        else if(maxi == res){\n            count++;\n        }\n        \n        return l+r+1;\n    }\n    int countHighestScoreNodes(vector<int>& parents) {\n        \n        int n = size(parents);\n        \n        maxi = -1;\n        count = 0;\n        N=n;\n        \n        vector<vector<int>> g(n);\n        \n        for(int i = 1; i < n; i++){\n            \n            g[parents[i]].push_back(i);\n        }\n        \n        dfs(g,0);\n        \n        return count;\n    }\n};\n```
['Depth-First Search', 'C', 'Binary Tree', 'C++']