My output is right then also wrong answer

int t = 0;
Scanner sc = new Scanner(System.in);
if (sc.hasNext()) {
t = sc.nextInt();
}
while (t-- != 0) {
int n = sc.nextInt();
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();

		}
		String s = "";
		for (int i = 0; i < n; i++) {
			if (s.compareTo(""+a[i]) > 0) {
				s += a[i];
			} else {
				s = a[i] + s;
			}
		}
		for(int i =0;i<s.length();i++) {
			System.out.print((int)(s.charAt(i)-48));
		}
		
	}

here is one sample test case.
INPUT:
1
4
0 90 32 9009

EXPECTED OUTPUT: 909009320
try to debug with this