I wrote almost correct code but not able to figure out what i missed because of which I am getting wrong answer
Form biggest number wrong answer
#include
#include
#include
#include
using namespace std;
int mycompare(string x,string y)
{
string xy=x.append(y);
string yx=y.append(x);
return xy.compare(yx)>0?1:0;
}
using namespace std;
int main() {
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
vector arr;
arr.reserve(n);
for(int i=0;i<n;i++)
{ string k;cin>>k;
arr.push_back(k);
}
sort(arr.begin(),arr.end(),mycompare);
for(int i=0;i<n;i++)
cout<<arr[i];
}
return 0;
}
@piyush.bansal8158625 hey piyush there is only one issue in your code you forget to add endline after each test cases