Super Simple Solution :)
Intuition\nNote that we need to ensure that our subgraph is a star graph. However, if we take a node u and look at a subset of its neighbors, we are guaranteed 
# Intuition\nNote that we need to ensure that our subgraph is a **star graph**. However, if we take a node $$u$$ and look at a subset of its neighbors, we are guaranteed that the resulting subgraph is a star graph as all of the nodes have $u$ in common! Therefore, we simply just need to take the largest $k$ nodes that each node $u$ is connected to. Note that we can choose to exclude some nodes if their value is $< 0$ as they will not increase our sum (it is better for us to leave them out).\n\n**Time Complexity:** The time complexity is dominated by the sorting step. If we let $E$ denote the number of edges in the graph, then our algorithm runs in $O(E \\log E)$ due to the sorting step.\n\nPlease upvote if you found this helpful, as I am trying to reach 10+ reputation:)\n\n# Code\n```\nclass Solution:\n    def maxStarSum(self, vals: List[int], edges: List[List[int]], k: int) -> int:\n        G = collections.defaultdict(list)\n        for u, v in edges:\n            G[u].append(vals[v])\n            G[v].append(vals[u])\n        \n        for u in G:\n            G[u].sort(reverse=True)\n            \n        res = float("-inf")\n        for u in range(len(vals)):\n            currSum = vals[u]\n            for i in range(min(k, len(G[u]))):\n                if G[u][i] < 0:\n                    break\n                else:\n                    currSum += G[u][i]\n            res = max(res, currSum)\n        return res\n\n```
['Python3']