Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save codeperfectplus/a94f51083ed623bc2249956673128ba5 to your computer and use it in GitHub Desktop.

Select an option

Save codeperfectplus/a94f51083ed623bc2249956673128ba5 to your computer and use it in GitHub Desktop.
vector<int> compareTriplets(vector<int> a, vector<int> b) {
vector<int> result;
int aliceScore = 0;
int bobScore = 0;
for(int i=0;i<a.size();i++){
if(a[i] > b[i])
aliceScore ++;
else if(b[i] > a[i])
bobScore++;
}
result.push_back(aliceScore);
result.push_back(bobScore);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment