cpp easy solution using recursion
```\nclass treeNode{\n    public:\n        treeNode left,right;\n        int val;\n    \n    treeNode(int val){\n        this->val=val;\n        left=right=NULL
```\nclass treeNode{\n    public:\n        treeNode* left,*right;\n        int val;\n    \n    treeNode(int val){\n        this->val=val;\n        left=right=NULL;\n    }\n};\n\nclass Solution {\npublic:\n    unordered_map<long long int,int>ans;\n    int func(treeNode* root,int n){\n        if(!root)return 0;\n        \n        int a=0,b=0;\n        a=func(root->left,n);\n        b=func(root->right,n);\n        \n        long long int t=1,m=n-(a+b+1);\n        if(a!=0)t*=a;\n        if(b!=0)t*=b;\n        if(m!=0)t*=m;\n        \n       \n        ans[t]++;\n        \n        return a+b+1;\n    }\n    \n    int countHighestScoreNodes(vector<int>& parents) {\n        int n=parents.size();\n        unordered_map<int,treeNode*>m;\n        \n        for(int i=0;i<n;i++){\n            treeNode* root=new treeNode(i);\n            m[i]=root;\n        }\n        \n        for(int i=1;i<n;i++){\n            int ele=parents[i];\n            if(m[ele]->left==NULL)m[ele]->left=m[i];\n            else m[ele]->right=m[i];\n        }\n        \n        func(m[0],n);\n        \n        long long int maxi=0,t=0;\n        for(auto ele:ans){\n            if(ele.first>=maxi){\n                t=ele.second;\n                maxi=ele.first;\n            }\n        }\n        return t;\n    }\n};
['C++']