爱切水题
class Solution {
public:
int winningPlayerCount(int n, vector<vector<int>>& pick) {
int a[11][11],ans=0;
bool b[11];
for(auto x:pick)
{
if(!b[x[0]]&&++a[x[0]][x[1]]>x[0]) b[x[0]]=1,ans++;
}
return ans;
}
};
思路也是非常的简单,每次操作让对应数组加1,一旦满足条件,让对应bool数组改变,且ans++