My code is correct, but your testcases and it's answer are not

Every order should get accepted–

My code -
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
vector arr;
unordered_map<int,int> m;
for(int i=0;i<n;i++){
int val;
cin>>val;
m[val]++;
}

for(auto it:m){
	if(it.second==2){
		cout<<it.first<<", ";
	}
}

}

hello @anant016
u should print output in this format
image
to pass all test cases

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.