✅ C++ | Count space & map | Easy to understand
\nclass Solution {\npublic:\n\t// this function will return the number of words in the given string\n    int countWord(string s){\n        int cnt=1;\n        f
```\nclass Solution {\npublic:\n\t// this function will return the number of words in the given string\n    int countWord(string s){\n        int cnt=1;\n        for(int i=0;i<s.size();i++) \n            if(s[i]==\' \') cnt++;\n        return cnt;\n    }\n    string largestWordCount(vector<string>& messages, vector<string>& senders) {\n        map<string,int> mp;\n        for(int i=0;i<messages.size();i++){\n            int cnt=countWord(messages[i]); // count the number of word in i-th string\n            mp[senders[i]]+=cnt; // store it into the map\n        }\n        string ans="";\n        int count=0;\n\t\t// now just check the highest number of words\n        for(auto x:mp){\n            if(x.second>count or (x.second==count and x.first>ans)){\n                ans=x.first;\n                count=x.second;\n            }\n        }\n        return ans;\n    }\n};\n```\n\n**If you like this, Do Upvote!**
['C']