Proper DFS Solution || C++ most intuitive Solution 
Intuitionjust keep track of the number of nodes in the left subtree and right subtree of a node and the number of nodes in the upper part
number of nodes in the
# Intuition
just keep track of the number of nodes in the left subtree and right subtree of a node and the number of nodes in the upper part 
`number of nodes in the upper part = n - (left subtree nodes+ right   subtree nodes +1(the node itself))` perform the dfs just like we do in tree and update populate the nodes in a map , at last find the max score and number of nodes having that score .

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:O(N)

- Space complexity:O(N)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int  dfs(unordered_map<int ,int>& left, unordered_map<int,int>& right , unordered_map<int,int>& parent,vector<int> adj[] , int node, int n){
          if(adj[node].size()==0){
            left[node]=0;
            right[node]=0;
            parent[node]=n-1;
            return 1;
          }
          vector<int> ref = adj[node];
          if(ref.size()!=1){
              int  lft  = dfs(left, right ,parent ,adj, ref[0], n);
              left[node]= lft;
              int  rght = dfs(left, right, parent ,adj, ref[1],n );
              right[node] = rght ;
              parent[node] = n-(lft+rght+1);
              return lft+rght +1;
          }
          else{
            int lft = dfs(left, right, parent ,adj, ref[0],n);
            left[node]= lft;
            right [node]=0;
            parent[node] = n-(lft+1);
            return lft+1;
          }

    }
    int countHighestScoreNodes(vector<int>& parents) {
        int n = parents.size();
        vector<int> adj[100001];
        for(int i=0;i<n;i++){
            int u = parents[i];
            int v =i;
            if (u !=-1) adj[u].push_back(i);
        }
       unordered_map<int,int> left;
       unordered_map<int, int > right ;
       unordered_map<int,int> parent ;
       dfs(left , right, parent , adj,0,n);
       long long  ans = INT_MIN;
       for(int i=0;i<n;i++){
           long long lft = 1LL*left[i];
           long long  rght  = 1LL*right[i];
           long long  Parent= 1LL*parent[i];
           lft!=0?:lft=1LL*1;
           rght!=0?:rght=1LL*1;
           Parent!=0?:Parent=1LL*1;
           ans = max(ans , 1LL*lft*rght*Parent);
       }
       int count =0;
       for(int i=0;i<n;i++){
           long long lft = 1LL*left[i];
           long long  rght  = 1LL*right[i];
           long long  Parent= 1LL*parent[i];
           lft!=0?:lft=1LL*1;
           rght!=0?:rght=1LL*1;
           Parent!=0?:Parent=1LL*1;
           if(1LL*lft*rght*Parent == ans) count++;
       }
       return count ;
    }
};
```
['C++']