My issue
Why am I getting wrong answer? I am unable to figure out what’s the problem with my code.
My code
#include<iostream>
#include<map>
#define ll long long int
using namespace std;
int main(){
int ca;cin>>ca;
while(ca--){
ll n;cin>>n;
map<ll,ll> mp;
for(ll i=0;i<n;i++){
ll a;cin>>a;
mp[a]++;
}
for(auto it:mp){
if(it.second!=2){
cout<<it.first<<endl;break;
}
}
}
}
Learning course: Arrays, Strings & Sorting
Problem Link: Chef and Dolls Practice Problem in Arrays, Strings & Sorting - CodeChef