Easy Java solution
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 {\n    public int maxStarSum(int[] vals, int[][] edges, int k) {\n    int max=-(int)1e9;\n       int n=vals.length;\n        for(int i=0;i<n;i++){\n            max=Math.max(max,vals[i]);\n        }\n        //storing the adj list in list of priorityQueue of integer of vals(not edge nodes) for storing max\n        //value of vals top\n        List<PriorityQueue<Integer>> l=new ArrayList<>();\n        for(int i=0;i<n;i++){\n            l.add(new PriorityQueue<>(Collections.reverseOrder()));\n        }\n        \n        for(int p[]:edges){\n            //storing nodes along with values(vals) of other nodes\n            l.get(p[0]).add(vals[p[1]]);\n            l.get(p[1]).add(vals[p[0]]);\n        }\n        for(int i=0;i<l.size();i++){\n            if(l.get(i).size()==0)continue;\n            PriorityQueue<Integer> p=l.get(i);\n            int u=k;\n            int sum=vals[i];\n            while(p.size()>0 && u-->0){\n                int it=p.poll();\n                //everytime updating max\n                max=Math.max(max,sum);\n                sum+=it;  \n            }\n            max=Math.max(max,sum);\n        }\n        return max;\n    }\n}\n```
['Java']