#include <bits/stdc++.h>
using namespace std;
int a[200009];
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    map<int, int> mp;
    mp[0] = 0;
    for (int i = 1, x; i <= n * 2; i++) {
      cin >> x;
      if (x == 2) x = -1;
      a[i] = a[i - 1] + x;
      if (i <= n) {
        mp[a[i]] = i;
      }
    }
    int ans = n * 2;
    for (int i = n; i <= n * 2; i++) {
      auto it = mp.find(a[i] - a[n * 2]);
      if (it != mp.end()) ans = min(ans, i - it->second);
    }
    cout << ans << "\n";
  }
  return 0;
}
