Form Biggest Number Code Doubt

In your image on discuss it was written y+x>x+y but it showing reverse can you please fix it and also when i tried to solve it on leetcode it is showing error

Share leetcode problem link with me here

didn’t understand this part, please elaborate.

I have asked you this question before also int that you provided me an image where two cases where there in consideration. In that you took an int a and put in string x and int b and put it in string y then we add those x and y in the image you wrote in mycompare function return y+x>x+y or vice versa

In the image i have given it by example:
54 546 548 60
Right?
So what our comparator function does is:

Comparing (x+y): 54654 & (y+x): 54546 so return will be true as (x+y)>(y+x)
Comparing (x+y): 548546 & (y+x): 546548 so return will be true as (x+y)>(y+x)
Comparing (x+y): 60548 & (y+x): 54860 so return will be true as (x+y)>(y+x)
So final answer will be 6054854654 in sorted array as per comparator

Try for different input here, you will get the intuition behind the approach. If still have any doubt left feel free to ask.

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.