In above question

the test case which I am generaing is working fine, also the test case given in question is also showing right output. But I am unable to get correct answer while submitting it.

link to my solution

@vishaaltiwari1999 i your code
for testcase
t=1;
n=2;
900 900001
output is-900001900 which is wrong
correct output should be 900900001

Your compare function is wrong . While sorting you have to check which of the two is smaller when concatenated.
Like take s1= a+b
And s2 = b+a
Then compare s1 and s2. And return s1<s2. It would work