#include<iostream> #include<vector> #include<unordered_map> using namespace std; int main() { int t; scanf("%d",&t); while(t --) { int n; scanf("%d",&n); unordered_map<long,int> res; for(int i = 0;i < n;i ++) { long a; cin >> a; res[a] ++; } long ans = 0; for(auto x : res) { if(x.second%2==1) ans ^= x.first; } cout << ans << endl; } return 0; } |
Double click to view unformatted code.