#include <bits/stdc++.h>

using namespace std;

int n;
bool vis[1000005];
int num[1000005];
int a[1000005];
int t;

int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    int le = 1, ri = n;
    memset(num, 0, sizeof(num));
    memset(vis, 0, sizeof(vis));
    vis[1] = 1;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      vis[1] &= ++num[a[i]] == 1;
    }
    for (int i = 1; i < n && num[i]; i++) {
      vis[n - i + 1] = 1;
      if (num[i] > 1)
        break;
      if (a[le] == i)
        le++;
      else if (a[ri] == i)
        ri--;
      else
        break;
    }
    for (int i = 1; i <= n; i++)
      cout << vis[i];
    cout << endl;
  }
  return 0;
}