Biggest number problem

i have tried to solve this problem by sorting the array in lexicographically decreasing order and it is giving the same output as sample output. but none of the test cases is passing and showing wrong answer . please tell what is wrong in my approach

given 2 numbers x and y in the string format, when you concatenate them the numbers could be either x+y or y+x, so while writing the compare function you should not compare x with y but x+y with y+x because you are forming x+y or y+x and your need bigger one.
Corrected code

1 Like

all test cases are passing now . thanks :+1:

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.