1class Solution {2public:3string largestWordCount(vector<string> &messages, vector<string> &senders) {4int n(size(messages));5map<string, int> m;6for (auto i = 0; i < n; i++) {7stringstream ss(messages[i]);8string word;9int count(0);10while (ss >> word) count++;11m[senders[i]] += count;12}1314int count(0);15string res;16for (auto &p : m) {17if (p.second >= count) {18count = p.second;19if (!res.empty() or res < p.first) res = p.first;20}21}22return res;23}24};