#include <bits/stdc++.h>
using namespace std;
const int MX = 200000 + 5;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
int p[MX];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      p[x] = i;
    }
    string s = "";
    int mn = MX, mx = 0;
    for (int i = 1; i <= n; i++) {
      mn = min(mn, p[i]);
      mx = max(mx, p[i]);
      if (mx - mn == i - 1)
        s += '1';
      else
        s += '0';
    }
    cout << s << endl;
  }
  return 0;
}
