String sort question code failed

what is wrong in the code?
#include<bits/stdc++.h>
#include
using namespace std;
bool myCompare(string a, string b) {
if (a.find(b)==0 || b.find(a)==0)
return a.length() > b.length();
return a < b;
}

int main() {
int n;
cin>>n;
vector v;
for(int i=0;i<n;i++)
{
string s;
cin>>s;
v.push_back(s);
}
sort(v.begin(),v.end(),compare);
for(int i=0;i<v.size();i++)
cout<<v[i]<<endl;

}

@vipuljaiswal you are passing the function “compare” but there is no function with that name, it is myCompare. I have made the changes here https://ide.codingblocks.com/s/220672 Please take care to share the code via ide in the future.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.