Faster than 100%
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        vector<priority_queue<int>>adj(vals.size());\n        for(int i=0; i<edges.size(); i++){\n            adj[edges[i][0]].push(vals[edges[i][1]]);\n            adj[edges[i][1]].push(vals[edges[i][0]]);\n        }\n        int ans= INT_MIN;\n        for(int i=0; i<adj.size(); i++){\n            int temp = vals[i];\n            int t = k;\n            ans = max(ans, temp);\n            while(!adj[i].empty() && t){\n                temp+=adj[i].top();\n                ans = max(ans, temp);\n                adj[i].pop();\n                t--;\n            }\n            \n        }\n\n        return ans;\n    }\n};\n```
['C++']