simple cpp solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\no(n^2)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\no(n)\n\n# Code\n```\nclass Solution {\npublic:\n    int solve(string a)\n    {\n        int c=0;\n        for(int i=0;i<a.length();i++)\n        {\n            if(a[i]==\' \')c++;\n        }\n        return c+1;\n    }\n    string largestWordCount(vector<string>& messages, vector<string>& senders) {\n        vector<pair<string,int>>v;\n        for(int i=0;i<messages.size();i++)\n        {\n            v.push_back({senders[i],solve(messages[i])});\n        }\n        unordered_map<string,int>m;\n        for(int i=0;i<v.size();i++)\n        {\n            m[v[i].first]+=v[i].second;\n        }\n        string ans="";\n        int temp=0;\n        for(auto it:m)\n        {\n            if(temp<it.second)\n            {\n                ans=it.first;\n                temp=it.second;\n            }\n            else if(temp==it.second)\n            {\n                if(ans<it.first)\n                {\n                    ans=it.first;\n                }\n\n            }\n        }\n        return ans;\n    }\n};\n```\n![upvote.jpg](https://assets.leetcode.com/users/images/ab9bddaa-881c-4ca3-a31d-bc14ccfd6b19_1676872335.3289537.jpeg)\n
['Array', 'Hash Table', 'String', 'Counting', 'C++']