Map
\nclass Solution {\n    public String largestWordCount(String[] messages, String[] senders) {\n        Map<String,Integer> map=new HashMap<>();\n        int max
```\nclass Solution {\n    public String largestWordCount(String[] messages, String[] senders) {\n        Map<String,Integer> map=new HashMap<>();\n        int max=0;\n        for(int i=0;i<messages.length;i++){\n            String s=messages[i];\n            String str[]=s.split(" ");\n            map.put(senders[i],map.getOrDefault(senders[i],0)+str.length);\n            max=Math.max(max,map.get(senders[i]));\n        }\n        \n        String res="";\n        for(String e: map.keySet()){\n            if(map.get(e)==max){\n                if(res.compareTo(e)<0){\n                    res=e;\n                }\n            }\n        }\n        return res;\n    }\n}\n```
['Java']