My issue
find my mistake
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[2*n];
int r=0;
int l=0;
for(int i=0;i<(2*n);i++){
cin>>a[i];
}
for(int j=0;j<(2*n);j++){
for(int k=0;k<(2*n);k++){
if(a[j]==a[k]){
l++;
}
}
}
if(l<=(2*n)+2){
cout<<"Yes"<<endl;
}
else{
cout<<"No"<<endl;
}
}
return 0;
}
Problem Link: Candies Practice Coding Problem