#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int i, n;
    cin >> n;
    int a[n + 1];
    int pos[n + 1];
    char ans[n + 1];
    for (i = 1; i <= n; i++) {
      cin >> a[i];
      pos[a[i]] = i;
    }
    if (n == 1) {
      cout << "1";
      cout << "\n";
    } else {
      int second[n + 1];
      int l[n + 1];
      ans[1] = '1';
      second[1] = pos[1];
      l[1] = pos[1];
      second[2] = pos[1];
      l[2] = pos[1];
      if (abs(pos[1] - pos[2]) == 1)
        ans[2] = '1';
      else
        ans[2] = '0';
      for (i = 3; i <= n; i++) {
        second[i] = min(second[i - 1], pos[i - 1]);
        l[i] = max(l[i - 1], pos[i - 1]);
        if (l[i] - second[i] + 1 == i and pos[i] > second[i] and pos[i] < l[i])
          ans[i] = '1';
        else if (l[i] - second[i] + 1 == i - 1 and
                 (pos[i] == second[i] - 1 or pos[i] == l[i] + 1))
          ans[i] = '1';
        else
          ans[i] = '0';
      }
      for (i = 1; i <= n; i++) cout << ans[i];
      cout << "\n";
    }
  }
  return 0;
}
