Easy Solution Heap C++
\n# Code\n\nclass Solution {\npublic:\n    string largestWordCount(vector<string>& m, vector<string>& s) {\n        ios::sync_with_stdio(false);\n        cin.ti
\n# Code\n```\nclass Solution {\npublic:\n    string largestWordCount(vector<string>& m, vector<string>& s) {\n        ios::sync_with_stdio(false);\n        cin.tie(NULL);\n        cout.tie(NULL);\n\n        unordered_map <string, int> mp;\n        int i, j;\n        for(i = 0; i < s.size(); i++)\n        {\n            int cnt = 0;\n            for(j = 0; j < m[i].size(); j++)\n            {\n                if(m[i][j] == \' \')\n                    cnt++;\n            }\n            mp[s[i]] += cnt + 1;\n        }\n\n        auto cmp = [&](string &a, string &b){\n            if(mp[a] == mp[b])\n            {\n                return a < b;\n            }\n            return mp[a] < mp[b];\n        };\n\n        priority_queue <string, vector <string>, decltype(cmp)> pq(cmp);\n        for(auto x : mp)\n            pq.push(x.first);\n        return pq.top();\n    }\n};\n```
['Hash Table', 'Heap (Priority Queue)', 'C++']