#include #define mem(a, b) memset(a, b, sizeof(a)) #define inf (1e18 + 7) using namespace std; int cas, n, num[100005]; map mps; int main() { scanf("%d", &cas); while(cas--) { mps.clear(); scanf("%d", &n); for(int i = 1;i <= n;i++) scanf("%d", &num[i]); int ans = 1; mps[num[1]]++; for(int i = 2;i <= n;i++) { if(mps[num[i]]) ans++, mps.clear(), mps[num[i]] = 1; else mps[num[i]]++; } printf("%d\n", ans); } return 0; }