#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)(1e17 + 17);
const long long mod = (long long)(1e9 + 7);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    vector<long long> idx(n + 1);
    set<long long> st;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      idx[a[i]] = i + 1;
    }
    st.insert(idx[1]);
    long long prev = 1;
    string ans = "1";
    for (long long i = 2; i <= n; i++) {
      long long xx = idx[i];
      long long s = *st.begin();
      long long e = *st.rbegin();
      if (prev == 1) {
        if (xx == s - 1 or xx == e + 1) {
          ans.push_back('1');
          st.insert(xx);
        } else {
          prev = 0;
          ans.push_back('0');
          st.insert(xx);
        }
      } else if (prev == 0) {
        if (xx > s and xx < e) {
          if (e - s + 1 == i) {
            st.insert(xx);
            ans.push_back('1');
            prev = 1;
          } else {
            st.insert(xx);
            ans.push_back('0');
            prev = 0;
          }
        } else {
          ans.push_back('0');
          st.insert(xx);
          prev = 0;
        }
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
