TreeMap | Java Solution
java\nclass Solution {\n    public String largestWordCount(String[] messages, String[] senders) {\n        Map<String, Integer> map = new TreeMap<>();\n        
```java\nclass Solution {\n    public String largestWordCount(String[] messages, String[] senders) {\n        Map<String, Integer> map = new TreeMap<>();\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        }\n        String ans = "";\n        int max = 0;\n        for (String key : map.keySet()) {\n            if (map.get(key) >= max) {\n                max = map.get(key);\n                ans = key.compareTo(ans) >= 0 ? key : ans;\n            }\n        }\n        return ans;\n    }\n}\n```
['String', 'Tree', 'Java']