String sort problem

i am not getting comparator which u made in this video

Hello @Tabrej_786 please share your partial code i will complete it and let you know the mistake.
Happy Learning!!

#include
#include
#include
using namespace std;
bool comp(string s1,string s2)
{ if(!s1.find(s2))
return s1.length()>s2.length();
return s1<s2;
}
int main()
{
int n;
cin>>n;
string s[n];
cin.get();
for(int i=0;i<n;i++)
{
getline(cin,s[i]);
}
sort(s,s+n,comp);
for(int i=0;i<n;i++)
cout<<s[i]<<endl;
return 0;
}

@Tabrej_786 you are not able to understand the code or what?

i did above code
but when i watch hint of video i didnt understand comprator in that

@Tabrej_786 he is doing the same way you have done in your code that is string ‘a’ is there in string ‘b’ and size of string b is greater then the size of the strinf a then b will come first and vice versa when string b is in string a.
otherwise we have to print lexographically.
if you still have any doubt you can ask here;
Happy Learning!!