#include using namespace std; typedef __int64 ll; const int N = 100000 + 10; ll a[N]; set s; int main() { //freopen("E://in.txt", "r", stdin); int T, n; scanf("%d", &T); while (T--) { scanf("%d", &n); s.clear(); int ans = 1; for (int i = 0; i < n; ++i) { scanf("%I64d", &a[i]); if (s.count(a[i])) { s.clear(); ++ans; } s.insert(a[i]); } printf("%d\n", ans); } return 0; }