could you tell me some examples of test cases my code is giving the wrong answer for?
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while(t–>0){
int m = s.nextInt();
String[] arr = new String[m];
for(int i = 0 ; i < m ; i++){
arr[i] = s.next();
}
Arrays.sort(arr);
String ans = “”;
for(int i = m-1 ; i >= 0 ; i–){
String str1 = ans+arr[i];
String str2 = arr[i]+ans;
int condch = (str1).compareTo(str2);
if(condch > 0){
ans = str1;
}
else{
ans = str2;
}
}
System.out.println(ans);
}
}
}