Created
September 10, 2023 11:51
-
-
Save codeperfectplus/a94f51083ed623bc2249956673128ba5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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