cpp best and easy sollution using MAP
class Solution {\npublic:\n    string largestWordCount(vector& messages, vector& senders) {\n        int n=senders.size();\n        unordered_map mp;\n        \
class Solution {\npublic:\n    string largestWordCount(vector<string>& messages, vector<string>& senders) {\n        int n=senders.size();\n        unordered_map<string,int> mp;\n        \n        for(int i=0;i<n;i++){\n            mp[senders[i]]++;\n            int size=messages[i].length();\n            for(int j=0;j<size;j++){\n                if(messages[i][j]==\' \')\n                    mp[senders[i]]++;\n            }\n        }\n        int count=0;\n        string ans="";\n        for(auto x : mp){\n            if(count<x.second){\n                count=x.second;\n                ans=x.first;\n            }\n            if(count==x.second and x.first>ans)\n                ans=x.first;\n        }\n        return ans;\n    }\n};
[]