Easy C++ solution using Priority Queue
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maxStarSum(vector<int>& vals, vector<vector<int>>& edges, int k) {\n        int n = vals.size();\n        vector<int> adj[n];\n        \n        // create adjacency list of graph\n        for(int i=0 ; i<edges.size() ; i++){\n            adj[edges[i][0]].push_back(edges[i][1]);\n            adj[edges[i][1]].push_back(edges[i][0]);\n        }\n        // create a maxi variable to store ans.\n        int maxi = INT_MIN;\n        \n        for(int i = 0 ; i<n ; i++){\n            int tmp = vals[i];\n            // create min heap to store vals\n            priority_queue<int , vector<int> , greater<int>> pq;\n            for(auto it:adj[i]){\n               pq.push(vals[it]);\n            // we have to take k edges that\'s why we have to remove extra value from heap (we remove top value bcoz min heap contain minimum value on its top)\n               if(pq.size()>k){\n                   pq.pop();\n               }\n            }\n            // for each node store the k centered values in tmp.\n            while(!pq.empty()){\n                if(pq.top()>0)\n                    tmp += pq.top();\n                pq.pop();   \n            }\n            // store the maximum value in maxi.\n            maxi = max(maxi , tmp);\n        }\n        return maxi;\n    }\n};\n```
['Heap (Priority Queue)', 'C++']