Simple Solution using Dictionary in Python
Intuition\n Describe your first thoughts on how to solve this problem. \nFirst of all , for this problem we are going to use a map which in python can be implem
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nFirst of all , for this problem we are going to use a map which in python can be implemented by using dictionary.\nWe are going to find the words count of every sender\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nIn python we create an empty dictionary and traversing the senders list , if a particular element of senders in not in dictionary then we create key value pair with key as senders name and value as the respective message(count of words).If the element of senders is already present then we just add the respective count of words to the existing one and keep track of the maximum value\n\nBy the above steps we get maximum and for every element in map we are going to check if the value is maximum and keep track of maximum and return it.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nFor traversing into the senders list and adding values  into the dictionary and keeping track of the maximum value takes O(n) and if we have multiple keys with same maximum traversing the map with the maximum and keeping track of answer takes O(n). Hence the time complexity is basically O(n+n) which equals O(n).\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nWe are using hashmap , which can be of size \'n\' in the worst case so..\nthe space complexity is O(n).\n\n# Code\n```\nclass Solution:\n    def largestWordCount(self, messages: List[str], senders: List[str]) -> str:\n        map = {}\n        m=0\n        ans=""\n        for i in range(len(senders)):\n            if senders[i] not in map:\n                map[senders[i]] =  messages[i].count(\' \')+1\n            else:\n                map[senders[i]]+= messages[i].count(\' \')+1\n            m=max(m,map[senders[i]])\n        for i,k in map.items():\n            if k==m:\n                ans=max(ans,i)\n        return ans\n        \n```
['Ordered Map', 'Python3']