Double HashMap Solution (Java)
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public int winningPlayerCount(int n, int[][] pick) {\n        Map<Integer, Map<Integer, Integer>> map = new HashMap<>();\n        for (int i = 0; i < n; i++) map.put(i, new HashMap<>());\n\n        for (int i = 0; i < pick.length; i++) {\n            int player = pick[i][0];\n            int color = pick[i][1];\n\n            Map<Integer, Integer> m = map.get(player);\n            m.put(color, m.getOrDefault(color, 0) + 1);\n        }\n\n        int count = 0;\n        for (int i = 0; i < n; i++) {\n            Map<Integer, Integer> m = map.get(i);\n\n            for (Map.Entry<Integer, Integer> entry : m.entrySet()) {\n                if (entry.getValue() > i) {\n                    count++;\n                    break;\n                }\n            }\n        }\n\n        return count;\n    }\n}\n```
['Java']