✅Simple Cpp Solution using Hashmap🔥
Intuition\nCount of total number of words in a string will equal to the count of spaces plus one.\n\n# Approach\n- At first we will create a map storing the sen
# Intuition\nCount of total number of words in a string will equal to the count of spaces plus one.\n\n# Approach\n- At first we will create a map storing the sender with their word count.\n- Then we will parse the map to find the sender with the maximum word-count.\n\n# Complexity\n- Time complexity:\nO(n) - Double pass Solution\n\n- Space complexity:\nO(n)\n\n# Code\n```\nclass Solution {\npublic:\n    string largestWordCount(vector<string>& messages, vector<string>& senders) {\n        map<string, int> m;\n\n        for(int i = 0; i < senders.size(); i++){\n            int wordCount = count(messages[i].begin(), messages[i].end(), \' \') + 1;\n            cout << wordCount << endl;\n            m[senders[i]] += wordCount;            \n        }\n\n        string ans = "";\n        int count = 0;\n        for(auto it : m){\n            if(it.second >= count){\n                count = it.second;\n                ans = it.first;\n            }\n        }\n\n        return ans;\n    }\n};\n```
['C++']