I wrote the following code andthought it to be correct but it doesnt pass any test case.
#include
#include<bits/stdc++.h>
using namespace std;
bool cmp (string a, string b)
{
if(a.compare(b) > 0)
return true;
else
return false;
}
int main() {
int j;
cin>>j;
while(j–)
{
int n;
cin>>n;
vectors(n);
// string s[n];
for(int i=0;i<n;i++)
{
string st;
cin>>st;
s[i]=st;
}
// cin>>s[i];
string res="";
sort(s.begin(),s.end(),cmp);
for(int i=0;i<n;i++)
{
cout<<s[i];
}
}
return 0;
}