How do i need to give the output?

if t > 1, the output should be in next line or comma separated or something else ??? no information has been given on how to give the output.

It should be in the next line.

then what is wrong with this?

Consider a case:
1
2
98 9

Expected O/p:
998

Your O/p:
989

The custom compare function must be something like this:
bool mycompare(string a,string b)
{
string ab=a+b;
string ba=b+a;
return ab>ba;
}

Consider the array [54, 546, 548, 60]

Consider the first two elements of the above array:
So in the compare function:
a=54
b=546
ab=54546
ba=54654
Since ba has a larger value than ab, so you have to sort such that b comes before a in the array.
So we return ab>ba (if ab forms the larger number a must come before b in the array and if ba forms the larger number b must come before a in the array)

thankyou bhaiiya : )