The output is correct but all my test cases show wrong answer

public class Main{

static void printBiggest(Vector<String> arr) {
	
	Collections.sort(arr,new Comparator<String>() {

		@Override
		public int compare(String X, String Y) {
			
			String XY= X + Y;
			String YX= Y + X;
			
			return XY.compareTo(YX) >0 ? -1:1;
		}
		
	});
	for(int i=0;i<arr.size();i++) {
		System.out.print(arr.get(i));
	}
	
}

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

	int t=scn.nextInt();
	while(t-->0) {
		int n=scn.nextInt();
		
		Vector<String> arr=new Vector<>();
		
		for(int i=0;i<n;i++) {
			arr.add(scn.next());
		}
		printBiggest(arr);
	}
	
	
}

}

@Utkarsh-Patiyal-2067329909961088 print every answer in new line tell if it works
if cleared dont forget to hit like and mark resolved :smiley:

nope ,it still shows wrong answer .All test cases are failing

@Utkarsh-Patiyal-2067329909961088 ok wait let me check

@Utkarsh-Patiyal-2067329909961088 i was telling you to print every test case ans in new line but now you are literally print every no in new (example-)
2
4
54 546 548 60
1
4

ans -
6054854654
4

your output -
60
548
546
54
4

check it

okay i got it ,thanks