return XY.compare(YX) > 0 ? 1: 0;what is meaning of this line
}
int main(int argc, char* argv[])
{
int t;
int n;
cin>>t;
while(t–) {
cin>>n;
vector arr;
for(int i=0;i<n;i++) {
string temp;
cin>>temp;
arr.push_back(temp);
}
sort(arr.begin(), arr.end(), myCompare);
for(int i=0;i<n;i++) {
cout<<arr[i];
}
cout<<endl;
}
return 0;
}
can you also explain the meaning of the main code
also please tell me a better approach for this problem .I’m not able to understand the working of problem.