代码:
#include<bits/stdc++.h>
using namespace std;
long long n,t,a[50005];
int main(){
ios::sync_with_stdio(false);
cin>>t;
while(t--){
memset(a,0,sizeof(a));
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
bool use[50005]={};
for(int i=1;i<=n;i++)if(use[a[i]]==0){
cout<<a[i]<<' ';
use[a[i]]=1;
}
cout<<'\n';
}
return 0;
}