js solution using map
\nvar largestWordCount = function(messages, senders) {\n    let map = new Map();\n    for(let i=0;i<messages.length;i++){\n        if(map.get(senders[i])){\n   
```\nvar largestWordCount = function(messages, senders) {\n    let map = new Map();\n    for(let i=0;i<messages.length;i++){\n        if(map.get(senders[i])){\n            map.set(senders[i],map.get(senders[i])+messages[i].split(\' \').length);    \n        }\n        else map.set(senders[i],messages[i].split(\' \').length);\n    }\n    let max=0,ans=\'\';\n    for(let [key,val] of map){\n        if(val>max){\n            max=val;\n            ans=key\n        }else if(val===max){\n            ans = key>ans ? key: ans;\n        }\n    }\n    return ans;\n};\n```
['JavaScript']