I was doing a program in which I have to sort strings first lexographically but if a string is a prefix in another string then string with longer length should comes first. But it is giving me right answer. Can you help me out??https://ide.codingblocks.com/s/451308
Regarding a program
Can you please elaborate what line 7 is doing?
it is finding starting index of string a in b .
if it comes 0 then that means a is prefix of b.
similary checking for string b in a.
if any of them give 0 then one string is prefix of other
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.