Form maximum number

I am getting correct answer for sample input.
but after submitting the code,it is giving all test cases wrong… what is wrong

hello @mmk32001
your comparator is not correct it will fail for following case.
2 21
ur comparator will order them as 212 but correct order is 221

define ur comparator something as follows

bool compare(string s1,string s2){
return s1+s2>s2+s1;
}