can anyone tell me why my code is giving WA.

https://www.codechef.com/BITB2021/problems/UNIBIT

#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define vi vector

#define mod 1e9+7

#define ff first

#define ss second

#define ins insert

#define endl “\n”

#define pie_op ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define tc int t;cin>>t;while(t–)

#define pb push_back

#define input(n) ll arr[n];for(int i1=0;i1<n;i1++)cin>>arr[i1]

int main()

{

pie_op;

tc

{

unordered_map<int,int>mp;

ll n;cin>>n;

input(n);

sort(arr,arr+n);

for(ll i=1;i<n;i++)

{

++mp[arr[i]];

}

for(int i=0;i<n;i++)

{

if(mp[arr[i]]==3)

{

cout<<arr[i]<<endl;

break;

}

}

}

return 0;

}