inlineintread(){ int r = 0,w = 1; char c = getchar(); while (c < '0' || c > '9'){ if (c == '-') w = -1; c = getchar(); } while (c >= '0' && c <= '9'){ r = (r << 3) + (r << 1) + (c ^ 48); c = getchar(); } return r * w; }
inlinevoidsolve(){ int cnt = 0; map<int,bool> vis; n = ans = read(); vis[0] = true; for (re int i = 1;i <= n;i++) arr[i] = read(); for (re int i = 1;i <= n;i++){ cnt ^= arr[i]; if (vis[cnt]){ vis.clear(); vis[0] = true; ans--; cnt = 0; } else vis[cnt] = true; } printf("%d\n",ans); }
intmain(){ int T; T = read(); while (T--) solve(); return0; }