Easy C++ code
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

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

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

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

# 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);
        
        // Build adjacency list
        for (auto& edge : edges) {
            int u = edge[0], v = edge[1];
            adj[u].push_back(v);
            adj[v].push_back(u);
        }
        
        int max_sum = INT_MIN;
        
        // Find the maximum star sum
        for (int i = 0; i < n; ++i) {
            priority_queue<int> max_heap;
            for (int neighbor : adj[i]) {
                if (vals[neighbor] > 0) {  // Only add positive values to the heap
                    max_heap.push(vals[neighbor]);
                }
            }
            
            int current_sum = vals[i];
            for (int j = 0; j < k && !max_heap.empty(); ++j) {
                current_sum += max_heap.top();
                max_heap.pop();
            }
            
            max_sum = max(max_sum, current_sum);
        }
        
        return max_sum;
    }
};
```
['C++']