Biggest Number Test case fail

Failing at a test case

Here’s the code

#include
#include
#include
#include

using namespace std;

bool compare(string c,string d)
{
string ab=c+d;
string ba=d+c;
return ab.compare(ba)>0;
}

int main()
{
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;

string s[n];
for(int i=0;i<n;i++)
cin>>s[i];

sort(s,s+n,compare);
for(int i=0;i<n;i++)
cout<<s[i];
}
cout<<endl;
return 0;
}

Use append function for compare . This will work .
https://ide.codingblocks.com/#/s/17819

It is one and the same thing. Even though i tried it using append function as well.

The code that i have given you is working fine and will pass all the test cases . Did you try with that code??