1 test case is wrong

please tell where my code is wrong
the code is-
#include
#include
#include
using namespace std;
bool mycompare(string a,string b)
{
string r=a.substr(0,b.length());
string s=b.substr(0,a.length());
if(r==b||r==a)
{
return a.length()>b.length();
}
else
{
return a<b;
}
}
int main() {
int n;
cin>>n;
int i;
string arr[n];
for(i=0;i<n;i++)
{
cin>>arr[i];
}
sort(arr,arr+n,mycompare);
for(i=0;i<n;i++)
{
cout<<arr[i]<<endl;
}
return 0;
}

@pragyachoudhary1111 hey pragya could you please share your implemented code through ide.codingblocks.com
so that I can debug asap

here is my code- https://ide.codingblocks.com/s/136504