easy approach 
Code

# Code
```cpp []
class Solution {
public:
    int maxStarSum(vector<int>& vals, vector<vector<int>>& edges, int k) {
        
        int n=vals.size();
        vector<vector<int>>adj(n);
        for(auto it:edges)
        {
            adj[it[0]].push_back(it[1]);
            adj[it[1]].push_back(it[0]);
        }
       
       int maxi=INT_MIN;
        for(int i=0;i<n;i++)
        {
             priority_queue<int,vector<int>>pq;
             for(auto it:adj[i])
             {
                pq.push(vals[it]);
             }
             int sum=vals[i];
             maxi=max(maxi,sum);
             int limit=k;
             while(limit>0&& !pq.empty())
             {
                 sum+=pq.top();
                 pq.pop();
                 maxi=max(maxi,sum);
                 limit--;
             }
        }
        return maxi;
    }
};
```
['Array', 'Greedy', 'Graph', 'Sorting', 'Heap (Priority Queue)', 'C++']