#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n + 1];
    map<long long, long long> m;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      m[a[i]] = i;
    }
    int p1 = m[1], p2 = m[1];
    int c = 0;
    string s;
    for (int i = 1; i <= n; i++) {
      if (i == 1 || i == n)
        s += '1', c++;
      else if ((m[i] > p1 && m[i] < p2)) {
        if (p2 - p1 == i - 1)
          s += '1', c++;
        else
          s += '0';
      } else if (m[i] == p1 - 1) {
        if (p2 - p1 + 1 == i - 1)
          s += '1';
        else
          s += '0';
        p1--;
      } else if (m[i] == p2 + 1) {
        if (p2 - p1 + 1 == i - 1)
          s += '1';
        else
          s += '0';
        p2++;
      } else if (m[i] < p1)
        p1 = m[i], s += '0';
      else if (m[i] > p2)
        p2 = m[i], s += '0';
    }
    cout << s << "\n";
  }
}
