Code Error. Please tell

Please tell about the code error and please tell how to implement the logic regarding batman and bat.

Hey @aryangrover
First of all, you don’t have to do it using the STL sort function. Write your own sort function. Also as it’s given,
if a string is present completely as a prefix in another string, then string with longer length should come first. Eg bat, batman are 2 strings and the string bat is present as a prefix in Batman - then sorted order should have - Batman, bat.
So you’ve to handle it this way when prefixes match, i.e. if a word is a prefix of the another, the bigger word comes first.

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.