#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
typedef pair<int, int > pii;
int a[N], v[N];
string s;
int sum[N];

int main() {
	int n, T;
	scanf("%d", &T);
	for (int t = 1; t <= T; t++) {
		scanf("%d", &n);
		bool falg = 0;
		memset(sum, 0, sizeof(sum));
		s = "";
		int i, j, l = 1, r = n, pos, ans = 0;
		for (i = 1; i <= n; i++) {
			scanf("%d", &a[i]);
			sum[a[i]]++;
		}
		for (i = 1; i <= n; i++)
			if (sum[i] != 1)
				break;
		if (i == n + 1)
			falg = 1;
		if (sum[i] == 0)
			i--;
		s = (sum[1]) ? "1" : "0";
		for (j = 1; j <= i - 1; j++) {
			if (a[l] == j) {
				pos = l;
				l++;
				sum[j]--;
				if (sum[j + 1])
					s = "1" + s;
			} else if (a[r] == j) {
				pos = r;
				r--;
				sum[j]--;
				if (sum[j + 1])
					s = "1" + s;
			} else
				break;
		}
		int len0 = n - s.length();
		for (j = 1; j <= len0; j++)
			s = "0" + s;
		s[0] = falg ? '1' : '0';
		cout << s << endl;
	}
}