#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 100;
int a[M];
void solve() {
  int n;
  cin >> n;
  int dif = 0;
  for (int i = 1; i <= 2 * n; i++) {
    cin >> a[i];
    dif += (a[i] == 1 ? 1 : -1);
  }
  if (dif == 0) {
    cout << "0"
         << "\n";
    return;
  }
  map<int, int> lf, rt;
  int sum = 0;
  lf[0] = n + 1;
  for (int i = n; i >= 1; i--) {
    sum += (a[i] == 1 ? 1 : -1);
    if (!lf[sum]) lf[sum] = i;
  }
  sum = 0;
  rt[0] = n;
  for (int i = n + 1; i <= 2 * n; i++) {
    sum += (a[i] == 1 ? 1 : -1);
    if (!rt[sum]) rt[sum] = i;
  }
  int ans = 2 * n;
  for (auto i : lf) {
    auto it = rt.find(dif - i.first);
    if (it != rt.end()) {
      ans = min(ans, it->second - i.second + 1);
    }
  }
  cout << ans << "\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
}
