Not able to solve using strings

sir/mam…I have tried solving this question using array of strings . The sample input is working fine but test cases are not working.

Consider a case:
1
2
98 9

Expected O/p:
998

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;
}

why can’t it be return a>b?

Dry run with the above case as i have mentioned to understand.

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.