what is the problem with my code
it is giving right answer for my cases. which cases are giving wrong answer for it?
#include
#include
using namespace std;
#include
int newt(string s1,string s2)
{unsigned int i=0,j=0;
while(i<s1.length() && j<s2.length())
{ int x=s1[i]-‘0’;
int y=s2[j]-‘0’;
if(x>y)
{
return 1;
}
else if(x<y)
return 0;
i++;
j++;
}
if(i==s1.length() && j!=s2.length()){
if((s1[s1.length()-1]-‘0’)<(s2[0]-‘0’))
return 1;
}
return 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,newt);
for(int i=0;i<n;i++)
{
cout<<s[i];
}
cout<<"\n";}
return 0;
}