Java Clean Simple Solution | BiWeekly Contest
Complexity\n- Time complexity:O(n+(keyk)each number)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(nk)\n Add your space complexity here, e
# Complexity\n- Time complexity:$$O(n+(key*k)each number)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(n*k)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\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++){\n            map.put(i, new HashMap<>());\n        }\n        \n        for(int[] p:pick){\n            int x= p[0], y=p[1];\n            map.get(x).put(y, map.get(x).getOrDefault(y, 0)+1);\n        }\n        \n        int res=0;\n        for(int key:map.keySet()){\n            Map<Integer, Integer> m = map.get(key);\n            int cnt=0;\n            for(int k:m.keySet()){\n                if(key<m.get(k)){\n                    res++;\n                    break;\n                }\n            }\n        }\n        return res;\n    }\n}\n```
['Array', 'Math', 'Ordered Map', 'Java']