Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class ChristmasTreeDecorationDiv2 {
public:
int solve(vector<int> col, vector<int> x, vector<int> y) {
int cnt=0;
for(int i=0;i<x.size();i++)
{
if(col[x[i]-1]!=col[y[i]-1])
cnt++;
}
return cnt;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment