Simple Solution Using HashMaps
Intuition\nIn the first loop, we count the occurence that a player pick a ball with a given color, while in the second loop, we check if the player won. \n\n# C
# Intuition\nIn the first loop, we count the occurence that a player pick a ball with a given color, while in the second loop, we check if the player won. \n\n# Complexity\n- Time complexity: $$O(len(pick))$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(len(pick))$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def winningPlayerCount(self, n: int, pick: List[List[int]]) -> int:\n        counter = collections.defaultdict(int)\n\n        for p in pick:\n            player, ball = p\n            counter[(player, ball)] += 1\n        \n        winners = set()\n        for k, v in counter.items():\n            if k[0] < v:\n                winners.add(k[0])\n        \n        return len(winners)\n```
['Python3']