#include #include #include #include #define clr(x) memset(x,0,sizeof(x)) using namespace std; set gold; int main() { int n,l,k,T,ans; scanf("%d",&T); while(T--) { scanf("%d",&n); ans=0; for(int i=1;i<=n;i++) { scanf("%d",&l); if(gold.find(l)!=gold.end()) { ans++; gold.erase(gold.begin(),gold.end()); gold.insert(l); } else gold.insert(l); } ans++; gold.erase(gold.begin(),gold.end()); printf("%d\n",ans); } return 0; }