#include
#include<bits/stdc++.h>
using namespace std;
int mycompare(string X, string Y)
{
// first append Y at the end of X
string XY = X.append(Y);
// then append X at the end of Y
string YX = Y.append(X);
// Now see which of the two formed numbers is greater
return XY.compare(YX) > 0 ? 1: 0;
}
int main() {
int t;
cin>>t;
while(t>0)
{
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[n];
}
sort(arr[0],arr[n-1],mycompare);
for(int i=0;i<n;i++)
{
cout<<arr[i];
}
}
return 0;
}
Please let me know the mistake