#include <bits/stdc++.h>
using namespace std;
using Pi = pair<int, int>;
using ll = long long;
string to_string(string s) { return s; }
template <class S>
string to_string(unordered_set<S> s);
template <class S>
string to_string(set<S> s);
template <class S, class T>
string to_string(map<S, T> m);
template <class T>
string to_string(vector<T> v);
template <class S, class T>
string to_string(pair<S, T> p) {
  return "{" + to_string(p.first) + "," + to_string(p.second) + "}";
}
template <class S>
string to_string(unordered_set<S> s) {
  string ret = "{";
  for (S x : s) ret += to_string(x) + ",";
  return ret + "}";
}
template <class S>
string to_string(set<S> s) {
  string ret = "{";
  for (S x : s) ret += to_string(x) + ",";
  return ret + "}";
}
template <class S, class T>
string to_string(map<S, T> m) {
  string ret = "{";
  for (pair<S, T> x : m) ret += to_string(x) + ",";
  return ret + "}";
}
template <class T>
string to_string(vector<T> v) {
  string ret = "{";
  for (int i = 0; i < (int)v.size() - 1; ++i) {
    ret += to_string(v[i]) + ",";
  }
  if (v.size() > 0) {
    ret += to_string(v.back());
  }
  ret += "}";
  return ret;
}
void debug() { cerr << endl; }
template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}
void print() { cout << endl; }
template <class Head, class... Tail>
void print(Head head, Tail... tail) {
  cout << to_string(head);
  print(tail...);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(2 * n);
    for (int i = 0; i < (int)2 * n; i++) {
      cin >> a[i];
      if (a[i] == 2) a[i] = -1;
    }
    vector<int> acc1(n + 1), acc2(n + 1);
    unordered_map<int, int> mp1, mp2;
    mp1[0] = n;
    mp2[0] = n;
    for (int i = 0; i < (int)n; i++) {
      acc1[i + 1] = acc1[i] + a[i];
      mp1[acc1[i + 1]] = n - 1 - i;
      acc2[i + 1] = acc2[i] + a[2 * n - 1 - i];
      mp2[acc2[i + 1]] = n - 1 - i;
    }
    int ans = (1 << 29);
    for (auto p : mp1) {
      if (mp2.find(-p.first) != mp2.end()) {
        ans = min(ans, p.second + mp2[-p.first]);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
