I have been taking inputs in the string and checking them lexicographically. I don’t know why every time output is the wrong answer. my other inputs work fine.
#include <bits/stdc++.h>
using namespace std;
bool compare(string a,string b)
{
return a>b;
}
int main() {
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
vector arr;
for(int i=0;i<n;i++)
{
string ok;
cin>>ok;
arr.push_back(ok);
}
sort(arr.begin(),arr.end(),compare);
for(int i=0;i<n;i++)
{
cout<<arr[i];
}
}
return 0;
}


