Form biggest no problem

https://ide.codingblocks.com/s/71351
where am i wrong

@Simran-Tuteja-2103059593355380 hey Simran your code is not working for this case.
1
8
1 34 3 98 9 76 45 4
your output is 989764543431
but the expected output is 998764543431.
I will recommend you to use the inbuilt sort function to sort the array with a custom comparator function.

could you please explain what should be the comparator

@Simran-Tuteja-2103059593355380
int myCompare(string X, string Y)
{
// first append Y at the end of X

// then append X at the end of Y


// Now see which of the two formed numbers is greater
return XY.compare(YX) > 0 ? 1: 0;

}

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.