#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
using namespace std;
double PI = 3.1415926535897;
const int N = 2e5 + 5, M = 1e2 + 5, MOD = 1e9 + 7, inf = 0x3f3f3f3f;
int tc, n, idx, ar[N], res[N];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  scanf("%d", &tc);
  while (tc--) {
    set<int> st;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      scanf("%d", ar + i);
      if (ar[i] == 1) idx = i;
    }
    res[1] = 1;
    res[n] = 1;
    st.insert(1);
    int r = idx + 1;
    int l = idx - 1;
    while (l > 0 || r < n) {
      if (r >= n) {
        st.insert(ar[l]);
        l--;
      } else if (l < 0) {
        st.insert(ar[r]);
        r++;
      } else if (ar[l] > ar[r]) {
        st.insert(ar[r]);
        r++;
      } else if (ar[r] > ar[l]) {
        st.insert(ar[l]);
        l--;
      }
      if (*(--st.end()) == st.size()) {
        res[st.size()] = 1;
      }
    }
    for (int i = 1; i <= n; i++) {
      printf("%d", res[i]);
      res[i] = 0;
    }
    puts("");
  }
  return 0;
}
