#include <bits/stdc++.h>
int t, n, per[200001], where[200001];
int groupcnt;
int main() {
  scanf("%d", &t);
  for (int test = 0; test < t; test++) {
    scanf("%d", &n);
    groupcnt = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &per[i]);
      where[per[i]] = i;
    }
    for (int i = 1; i <= n; i++) {
      groupcnt++;
      int location = where[i];
      if (location > 1 && per[location - 1] < i) groupcnt--;
      if (location < n && per[location + 1] < i) groupcnt--;
      if (groupcnt == 1)
        printf("1");
      else
        printf("0");
    }
    printf("\n");
  }
  return 0;
}
