Challenge problem

my code is running perfectly on eclipse but here it is showing error. can anyone tell me why?
my code is lengthy.

import java.util.*;

public class Main {

static Scanner scn = new Scanner(System.in);
public static void main(String args[]) {
	int t = scn.nextInt();
	for (int i = 0; i < t; i++) {
		int[] arr = null;
		arr = take_input();
		maxinumber(arr);
	}
}
public static int[] take_input() {
	int n = scn.nextInt();
	int[] arr = new int[n];
	for (int i = 0; i < n; i++) {
		arr[i] = scn.nextInt();
	}
	return arr;
}

public static void maxinumber(int[] arr) {
	int i, j;
	for (i = 0; i < arr.length - 1; i++) {
		for (j = 0; j < arr.length-1; j++) {
			arr = check_greater(arr, arr[j], arr[j + 1], j, j + 1);
		}
	}
	for (i = arr.length-1; i >=0; i--) {
		System.out.print(arr[i]);
	}
}

public static int[] check_greater(int[] arr, int x, int y, int u, int v) {
	int n1 = x, n3 = x, n2 = y, n4 = y, count1 = 0, count2 = 0;
	while (n1 != 0) {
		count1++;
		n1 = n1 / 10;
	}
	while (n2 != 0) {
		count2++;
		n2 = n2 / 10;
	}
	int[] ax = new int[count1 + count2];
	int[] ay = new int[count1 + count2];
	int i;
	for (i = 0; i < count2; i++) {
		int rem = n4 % 10;
		ax[i] = rem;
		n4 = n4 / 10;
	}
	for (i = count2; i < ax.length; i++) {
		int rem = n3 % 10;
		ax[i] = rem;
		n3 = n3 / 10;
	}
	for (i = 0; i < count1; i++) {
		int rem = x % 10;
		ay[i] = rem;
		x = x / 10;
	}
	for (i = count1; i < ay.length; i++) {
		int rem = y % 10;
		ay[i] = rem;
		y = y / 10;
	}
	int sum1 = 0, sum2 = 0;
	for (i = 0; i < ax.length; i++) {
		sum1 = sum1 + ax[i] * (int) Math.pow(10, i);
	}
	for (i = 0; i < ay.length; i++) {
		sum2 = sum2 + ay[i] * (int) Math.pow(10, i);
	}
	if (sum1 > sum2) {
		int tmp = arr[v];
		arr[v] = arr[u];
		arr[u] = tmp;
	}
	return arr;
}

}

Hey @VinayakSingh11111
Q 1. my code is lengthy./
Answer Yes
Your code failed on large input.
try to solve Simple Way .
The idea is to use any comparison based sorting algorithm. In the used sorting algorithm, instead of using the default comparison, write a comparison function myCompare() and use it to sort numbers. Given two numbers X and Y, how should myCompare() decide which number to put first – we compare two numbers XY (Y appended at the end of X) and YX (X appended at the end of Y). If XY is larger, then X should come before Y in output, else Y should come before. For example, let X and Y be 542 and 60. To compare X and Y, we compare 54260 and 60542. Since 60542 is greater than 54260, we put Y first.