What's the mistake ? kindly check and modify

hi @vanshikasharma1645 this should be the compare function

bool comparator(string s1, string s2){
    if (s1.find(s2) != string::npos) {
        return s1.length() > s2.length();
//if substring is found, string with bigger length should come first
    }
    if (s2.find(s1) != string::npos) {
        return s2.length() > s1.length();
    }

//else sort lexicographically
    return s1 < s2;
}

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.