#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, k, t, sum = 0, l;
  cin >> t;
  while (t--) {
    cin >> n;
    m = 0, l = n - 1;
    sum = 0;
    vector<long long int> v, a(n + 1, 0);
    for (long long int i = 0; i <= n - 1; i++) {
      cin >> k;
      v.push_back(k);
      sum += k;
    }
    while (1) {
      if (sum == 0) break;
      k = l - m + 1;
      k = k * (k + 1) * 0.5;
      if (k == sum) a[l - m + 1]++;
      if (v[l] > v[m])
        sum -= v[l], l--;
      else
        sum -= v[m], m++;
    }
    for (long long int i = 1; i <= n; i++) cout << a[i];
    cout << endl;
  }
  return 0;
}
