#include using namespace std; typedef long long ll; typedef unsigned long long ull; #define rep(i, a, b) for(int i(a); i <= (b); ++i) #define dec(i, a, b) for(int i(a); i >= (b); --i) #define MP make_pair const int INF = 0x3f3f3f; const int N = 100000 + 10; const int M = 10000 + 10; const int Q = 1500 + 10; const int A = 100 + 10; int a[N]; int main(){ int T; scanf("%d",&T); while(T--){ int n; scanf("%d",&n); for(int i=1 ;i<=n ;i++){ scanf("%d",&a[i]); } int ans = 0; for(int i=1 ;i<=n ;){ set S; ans++; while(S.find(a[i]) == S.end() && i<=n){ S.insert(a[i]); i++; } } printf("%d\n",ans); } return 0; }