C++ || HashMap with comparison
The code is self explanatory\n\n```\nclass Solution {\npublic:  \n    \n    static bool cmp(pair& a, pair& b)  // always remember in a class the sort function n
The code is self explanatory\n\n```\nclass Solution {\npublic:  \n    \n    static bool cmp(pair<int,string>& a, pair<int,string>& b)  // always remember in a class the sort function needs                                                                          static function.\n    {\n        if(a.first == b.first) return a.second > b.second;\n        return a.first > b.first;\n    }\n       \n    string largestWordCount(vector<string>& m, vector<string>& s) {\n        vector<pair<int,string>> v;\n        unordered_map<string,int> mp; // use map to cover the cases of multiple msg on same name.\n        \n        for(int i = 0; i < s.size(); i++)\n        {\n            int c= 0;\n            for(int j = 0; j < m[i].size(); j++)\n            {\n                if(m[i][j] == \' \') c++; \n            }\n            \n            mp[s[i]] += c+1;\n        }\n        \n        for(auto k : mp) v.push_back({k.second, k.first});\n        sort(v.begin(), v.end(), cmp);\n        \n        return v[0].second;   \n        \n        \n    }\n};
['C']