DSS based Solution || C++
\n\n\n\n#define ll long long\nclass Solution {\npublic:\n    \n    struct Node\n{\n    Node* left;\n    Node* right;\n    int val;\n    ll count;//to store coun
```\n\n\n\n#define ll long long\nclass Solution {\npublic:\n    \n    struct Node\n{\n    Node* left;\n    Node* right;\n    int val;\n    ll count;//to store count(left)+count(right)\n    Node(int c)\n    {\n        left=NULL;\n        right=NULL;\n        count=0;\n        val=c;\n    }\n};\n\n    \n    \n    //normal dfs after tree construction\n    vector<ll>v;\nint recurs(Node* root,int n)\n{\n    if(!root)\n        return 0;\n    \n    \n    int left=recurs(root->left,n);\n    int right=recurs(root->right,n);\n    root->count=left+right;\n    \n\n    \n    ll left1=left,right1=right;\n    \n    if(left1==0)\n         left1=1;\n    if(right1==0)\n          right1=1;\n   ll val=(n-1-left-right);\n    if((n-1-left-right)==0)\n         val=1;\n    \n    v.push_back(left1*right1*(val));\n    return root->count+1;\n}\n    \n    int countHighestScoreNodes(vector<int>& parent) {\n        v.clear();\n        int n=parent.size();\n        \n        \n        //tree construction\n        vector<Node*>tree(n);\n        \n        for(int i=0;i<n;i++)\n        {\n            tree[i]=new Node(i);\n        }\n        \n        for(int i=0;i<n;i++)\n        {\n            if(parent[i]!=-1)\n            {\n                if(tree[parent[i]]->left==NULL)\n                    tree[parent[i]]->left=tree[i];\n                else\n                    tree[parent[i]]->right=tree[i];\n            }\n        }\n        \n        Node* root=tree[0];\n        recurs(root,n);\n        int c=0;\n        \n        sort(v.rbegin(),v.rend());\n        \n        for(int i=0;i<n;i++)\n        {\n         // cout<<i<<" : "<<v[i]<<endl;\n            if(v[i]==v[0])\n                 c++;\n            else\n                 break;\n        }\n        return c;\n    }\n};\n```
['Depth-First Search', 'C']