#include using namespace std; const int maxn =100000 + 5; int a[maxn]; int main() { int t;cin>>t; while(t--) { int n; scanf("%d",&n); for(int i=1;i<=n;++i) { scanf("%d",&a[i]); } map mp; mp.clear(); int ans = 1; for(int i=1;i<=n;++i) { if(mp[a[i]] == false) { mp[a[i]]=true; } else { ans++; mp.clear(); mp[a[i]] = true; } } printf("%d\n",ans); } }