Test case not passing , please tell what am i missing

for the input
8
1 34 3 98 9 76 45 4
Expected Output
998764453341
correct Output
998764543431

Correct and Simplest approach for this problem

Logic:
we consider both the cases a+b and b+a as well
and then accordingly return true or false from compare function

NOTE:
int atoi (const char * str); Convert string to integer.
atoi takes char* and return integer corresponding to str
so in the code first i convert string to char* and then use atoi

i hope this helps
if your doubt is resolved don’t forgot to mark it as resolved

https://ide.codingblocks.com/s/386300 Although i am passing all test cases, would u suggest any changes or something which should change or avoid???

yes that is also correct

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.