C++
\nclass Solution {\npublic:\n    static bool cmp(vector<int>&a, vector<int>&b){\n        if(a[0] == b[0])\n            return a[1] < b[1];\n        return a[0] 
```\nclass Solution {\npublic:\n    static bool cmp(vector<int>&a, vector<int>&b){\n        if(a[0] == b[0])\n            return a[1] < b[1];\n        return a[0] < b[0];\n    }\n    int winningPlayerCount(int n, vector<vector<int>>& pick) {\n        sort(pick.begin(), pick.end(), cmp);\n        int ret = 0;\n        int idx = pick[0][0];\n        int count = 0;\n        int color = pick[0][1];\n        vector<bool>flag(n);\n        for(int i = 0; i < pick.size(); i++){\n            if( idx == pick[i][0] ){\n                if(pick[i][1] == color)\n                    count++;\n                else{\n                    color = pick[i][1];\n                    count = 1;\n                }\n            }\n            else{\n                idx = pick[i][0];\n                color = pick[i][1];\n                count = 1;\n            }\n            if(count > idx){\n                flag[idx] = true;\n            }\n        }\n        for(int i = 0; i < n; i++)\n            ret += flag[i];\n        return ret;\n    }\n};\n\n```
[]