Explanation of everyone's short code | C++
```\nclass Solution {\npublic:\n    unordered_map> adj;\n    vector arr;\n    \n    int dfs(int src,int parent,int target)\n    {\n        int sum=arr[src]; //m
```\nclass Solution {\npublic:\n    unordered_map<int,vector<int>> adj;\n    vector<int> arr;\n    \n    int dfs(int src,int parent,int target)\n    {\n        int sum=arr[src]; //mai apne subtree ka sum nikal rha hu -> to pehle apni val\n          \n        for(auto i:adj[src])\n            if(i!=parent)\n              sum+=dfs(i,src,target);       \n        \n        if(sum==target)  //bhai mera subtree pura hai mai ab alag component bngya\n            return 0;   //thats why mera sb kuch bhuja (as if i dont exist. return 0)\n        \n        return sum;  //agar mai target ke equal nahi to kya pta parent ko help kru \n    }\n    \n    int componentValue(vector<int>& nums, vector<vector<int>>& edges) {\n        \n        //Step 1 Make graph\n        arr=nums;\n        for(auto e:edges)\n        {\n            adj[e[1]].push_back(e[0]);\n            adj[e[0]].push_back(e[1]);\n        }\n            \n        //Step 2 Calculate sum\n        int sum=0;\n        for(auto i:nums)\n            sum+=i;\n    \n        /* Step 3 -> 18 sum hai agar to kitne possible ways hai bnane ke compo :\n        -> 1 compoent bnaega 18 sum ka \n        -> 2 compoent bnaega 9 sum ka \n        -> 3 compoent bnaega 6 sum ka \n        -> 6 compoent bnaega 3 sum ka \n        -> 9 compoent bnaega 2 sum ka\n        -> 18 component bnaega 1 sum ka */\n        \n        for(int i=sum;i>=1;i--)  \n        {\n            if(sum%i==0)  // i components bn skte kya with every component val = n/i\n            {\n//IMPORTANT ->  i components bn pa rhe hai to edges i-1 remove hogi (Simple logic -> 2 compoent bnane hote to ek edge remove krte)\n                if(dfs(0,-1,sum/i)==0) \n                    return i-1; \n            }\n        }\n        return 0;\n    }\n};
[]