C++ solution using binary tree creation & then dfs for finding answer
struct TreeNode\n     {\n        TreeNode left =NULL;\n             TreeNode right=NULL ;\n             int val;\n             int totalcount=0;\n     };\n     
struct TreeNode\n     {\n        TreeNode* left =NULL;\n             TreeNode* right=NULL ;\n             int val;\n             int totalcount=0;\n     };\n       \n       int func(TreeNode* root , int n)\n       {\n               if(root==NULL)\n               {\n                       return 0;\n               }\n               \n               int x=func(root->left,n) + func(root->right,n)+1;\n               root->totalcount=x;\n               \n               return x;\n       }\n        \n    int countHighestScoreNodes(vector<int>& parents) {\n        int n=parents.size();\n            unordered_map<int ,TreeNode*> mp;\n            \n            //TreeNode* root=new TreeNode(0);\n            for(int i=0;i<n;i++)\n            {\n                 TreeNode* node=new TreeNode();\n                    node->val=i;\n                    mp[i]=node;\n            }\n            for(int i=0;i<parents.size();i++)\n            {\n                    if(parents[i]!=-1)\n                    {\n                            TreeNode* node=mp[parents[i]];\n                            if(node->left==NULL)\n                            {\n                                    node->left=mp[i];\n                            }\n                            else\n                            {\n                                    node->right=mp[i];\n                            }\n                            \n                    }\n            }\n            TreeNode* root=mp[0];\n            func(root,n);\n            \n            long long ans=0;\n            int count=0;\n            long long currval;\n            int x1,x2;\n            for(auto it=mp.begin();it!=mp.end();it++)\n            {\n                    TreeNode* node=it->second;\n                    TreeNode* s1=node->left;\n                    TreeNode* s2=node->right;\n                     int nodeval=it->first;\n                    if(s1==NULL)\n                            x1=0;\n                    else\n                            x1=s1->totalcount;\n                    \n                    if(s2==NULL)\n                            x2=0;\n                    else\n                            x2=s2->totalcount;\n                    \n                    \n                  if(x1==0 && x2==0)\n                  {\n                          currval=n-1;\n                          if(nodeval==0)\n                                  currval=1;\n                  }\n                    else\n                            if(x1==0)\n                            {\n                                    currval=(long long)x2*(n-x2-1);\n                                    if(nodeval==0)\n                                            currval=x2;\n                            }\n                    else\n                            if(x2==0)\n                            {\n                                   currval=(long long)x1*(n-x1-1);\n                                    if(nodeval==0)\n                                            currval=x1;\n                            }\n                    else\n                    {\n                            currval=(long long)((long long)x1*(x2)*(long long)(n-x1-x2-1));\n                            if(nodeval==0)\n                                    currval=(long long)x1*x2;\n                    }\n                    \n                 \n                    if(currval==ans)\n                    {\n                            count++;\n                    }\n\t\t\t\t\t   if(currval>ans)\n                    {\n                            ans=currval;\n                            count=1;\n                    }\n                    \n                    \n            }\n            \n            return count;\n            \n              \n    }
['C', 'Binary Tree', 'C++']