Testcase fails . help me sir

even my sample test is running well why is there no testcase is running

Hey @shudhanshu20092001_af6f20d24c617008 As we can clearly see from the constraints of the input in the question the Output can be very very large which can’t be stored even in long. So you have to use String to store final answer instead of int or long.

sir still the code is not accepted

hey @shudhanshu20092001_af6f20d24c617008 benchmark your code with my code in the link below.
https://ide.codingblocks.com/s/665318

sir your code is not available in the link you have shared

@shudhanshu20092001_af6f20d24c617008 Here is the code :

import java.util.*;
public class Main {
   public static Scanner scan = new Scanner(System.in);

    public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

        int tc = scn.nextInt();

        while (tc > 0) {
            int n = scn.nextInt();

            int[] arr = new int[n];

            for (int i = 0; i < arr.length; i++) {
                arr[i] = scn.nextInt();
            }

            sort(arr);

            display(arr);
            tc--;
        }
    }

    public static void display(int[] arr) {
		String ans = "";
        for (int val : arr) {
            ans += val;
        }

        System.out.println(ans);
    }

    public static int[] takeInput() {
        int len = scan.nextInt();
        int[] arr = new int[len];
        for (int i = 0; i < len; i++) {
            arr[i] = scan.nextInt();
        }
        return arr;
    }

    public static void sort(int[] arr) {
        for (int i = 0; i < arr.length - 1; i++) {
            for (int j = 0; j < arr.length - i - 1; j++) {
                if (compare(arr[j], arr[j + 1]) > 0) {
                    int temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
    }

    public static int compare(int n1, int n2) {
        String val1 = n1 + "" + n2;
        String val2 = n2 + "" + n1;

        long val1int = Long.valueOf(val1);
        long val2int = Long.valueOf(val2);

        if (val1int > val2int)
            return -1;
        else
            return 1;
    }

}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.