C++ using hashmap
\nclass Solution {\npublic:\n    string largestWordCount(vector<string>& messages, vector<string>& senders) {\n        unordered_map<string,int> mp;\n        in
```\nclass Solution {\npublic:\n    string largestWordCount(vector<string>& messages, vector<string>& senders) {\n        unordered_map<string,int> mp;\n        int ans=INT_MIN;\n        string temp="-1";\n        for(int i=0;i<messages.size();i++){\n            int count=0;\n            stringstream sss(messages[i]);\n            string word;\n            while(sss>>word){\n                count++;\n            }\n            mp[senders[i]] += count;\n        }\n        for(auto it:mp)\n        {\n            if(it.second>ans)\n            {\n                ans=it.second;\n                temp=it.first;\n            }\n            else if(it.second==ans)\n            {\n                temp=max(temp,it.first);\n            }\n        }\n        return temp;\n    }\n};\n```
[]