STRING SORT PROBLEM

I am not able to understand this question can you please dry run it for me

Hello @mkidwai74 in this question you have to sort the array of the strings in the way that if the one string is contained in the other string then the string with greater length but if the string is lexicographically smaller then the string then that string should come first.

for eg if we take the sample test case:
string are apple bat and batman
so the sting apple is greater then every other string then we will add this as the first of the sorted string array.
then bat is completely prefix in the batman then the string with greter length out of two will come first.
that is why in yhis batman came at second.

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.