Hash Map
\n\n\n# Code\n\nfrom typing import List\n\nclass Solution:\n    def winningPlayerCount(self, n: int, pick: List[List[int]]) -> int:\n        library = {}\n     
![image.png](https://assets.leetcode.com/users/images/e5a2063f-df05-450c-a4fe-ad65ba22d5e0_1722745285.9471893.png)\n\n\n# Code\n```\nfrom typing import List\n\nclass Solution:\n    def winningPlayerCount(self, n: int, pick: List[List[int]]) -> int:\n        library = {}\n        for key, val in pick:\n            if key not in library:\n                library[key] = {}\n            if val not in library[key]:\n                library[key][val] = 0\n            library[key][val] += 1\n        winning_players = 0\n        for player in range(n):\n            if player in library:\n                for count in library[player].values():\n                    if count > player:\n                        winning_players += 1\n                        break\n        return winning_players\n\n\n```
['Python3']