Test case failed

code - https://ide.codingblocks.com/s/139909
i input the array as string and done sorting but it is showing wrong answer for one test case. i am thinking that may be my compare function would be wrong if in case 9 is encountered but i am not able to code it. Please tell the appropriate solution.

Hello @kushal1998,

  1. Output for each test case should be in a different line.

  2. Your compare function will fail for the test case like:
    1
    2
    9 96
    Your Output:
    969
    Expected Output:
    996

I have modified your code:

Hope, this would help.
Give a like, if you are satisfied.

1 Like

yes i am satisfied thanks a lot bhaia

No Problem.
Please, mark your doubt as resolved.

1 Like