Form Biggestnumber

Please give me an idea how to solve this question.
we can’t sort the array
should I compare the last digit of every number?

@dsingh200021
Take the number inputs as strings rather than integers and sort them using a custom comparator function.
In this comparator function , take two string arguments and use the append( ) function of class string to check appending which string after which string results in a larger number.

bool myCompare(string a,string b){
string s1=a.append(b);
string s2=b.append(a);
return s1>s2;
}

After the sorting simply output your array of strings as it is and you are done.