#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 1e6 + 10;
double PI = 3.1415926535898;
map<int, int> mmp;
int a[MAXN], lsum[MAXN], rsum[MAXN];
int main() {
  int q;
  cin >> q;
  while (q--) {
    mmp.clear();
    int n;
    cin >> n;
    for (int i = 0; i <= 2 * n + 1; i++) {
      lsum[i] = 0;
      rsum[i] = 0;
    }
    for (int i = 1; i <= 2 * n; i++) {
      cin >> a[i];
      if (a[i] == 2) a[i] = -1;
    }
    for (int i = 1; i <= n; i++) {
      lsum[i] = lsum[i - 1] + a[i];
    }
    for (int i = 2 * n; i >= n + 1; i--) {
      rsum[i] = rsum[i + 1] + a[i];
    }
    for (int i = 0; i <= n; i++) {
      mmp[lsum[i]] = i;
    }
    int ans = 0;
    for (int i = 2 * n + 1; i >= n + 1; i--) {
      int t = -rsum[i];
      if (mmp.count(t)) ans = max(ans, mmp[t] + 2 * n - i + 1);
    }
    cout << 2 * n - ans << endl;
  }
}
