#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 50;
const int INF = 0x3f3f3f3f;
int a[maxn];
int main() {
  std::ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int l, r;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      if (a[i] == 1) {
        l = i - 1;
        r = i + 1;
      }
    }
    int cnt = 2;
    string ans = "1";
    int ma = 2;
    while (cnt <= n) {
      if (l <= 0) a[l] = INF;
      if (r >= n + 1) a[r] = INF;
      if (r - l == cnt) {
        if (a[l] <= cnt)
          ma = max(a[l], ma), l--;
        else if (a[r] <= cnt)
          ma = max(a[r], ma), r++;
        else {
          if (a[l] < a[r])
            ma = max(a[l], ma), l--;
          else
            ma = max(a[r], ma), r++;
        }
        if (ma == cnt)
          ans += "1";
        else
          ans += "0";
      } else {
        if (a[l] < a[r])
          ans += "0", ma = max(a[l], ma), l--;
        else
          ans += "0", ma = max(a[r], ma), r++;
      }
      cnt++;
    }
    cout << ans << endl;
  }
  return 0;
}
