#include <bits/stdc++.h>
using namespace std;
ifstream fin("d.in");
int t, n;
int a[200005];
int f[200005];
int ok[200005];
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      f[a[i]] = i;
      ok[i] = 0;
    }
    ok[n + 1] = 0;
    sort(a + 1, a + n + 1);
    int cnt = 0;
    for (int m = 1; m <= n; m++) {
      int x = f[a[m]];
      ok[x] = 1;
      if (ok[x - 1] == 0 && ok[x + 1] == 0)
        cnt++;
      else if (ok[x - 1] == 1 && ok[x + 1] == 1)
        cnt--;
      if (cnt == 1)
        cout << "1";
      else
        cout << "0";
    }
    cout << "\n";
  }
  return 0;
}
