Help me in solving MISSP problem

My issue

help

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
    int i,j,t;
    arr[n];
    cin>>t;
    for(i=0;i<t;i++){
        cin>>n;
        for(j=0;j<n;j++){
         cin>>arr[j];   
        }
    }
}

Problem Link: Chef and Dolls Practice Coding Problem

@lakshitsingh91
the logic is calculate the xor of the whole array

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        int ans=0;
        while(n--)
        {
            int x;
            cin>>x;
            ans^=x;
        }
        cout<<ans<<endl;
    }
}