#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7, N = 2e5 + 7, M = 2e6 + 7, INF = INT_MAX / 10;
long long powe(long long x, long long y) {
  x = x % mod, y = y % (mod - 1);
  long long ans = 1;
  while (y > 0) {
    if (y & 1) {
      ans = (1ll * x * ans) % mod;
    }
    y >>= 1;
    x = (1ll * x * x) % mod;
  }
  return ans;
}
int arr[N];
int pre[N];
void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    cin >> arr[i];
    if (arr[i] != 1) arr[i] = -1;
  }
  pre[0] = 0;
  for (int i = 1; i <= 2 * n; i++) pre[i] = pre[i - 1] + arr[i - 1];
  int mini = 2 * n;
  map<int, int> hash;
  for (int i = 0; i <= n; i++) hash[pre[i]] = i;
  if (hash.count(pre[n] - pre[2 * n])) {
    mini = min(mini, n - hash[pre[n] - pre[2 * n]]);
  }
  for (int i = n + 1; i <= 2 * n; i++) {
    if (hash.count(pre[i] - pre[2 * n])) {
      mini = min(mini, i - hash[pre[i] - pre[2 * n]]);
    }
  }
  cout << mini << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
