Test case 1 is failing

code- https://ide.codingblocks.com/s/294868

hi @anubhavb11 i’d suggest you to use a custom compare function with the STL sort, do you know how that works or do you need help with that?

i need help but i cant understand whats the problem in this code

@anubhavb11 you have implemented everything from scratch so it could be anything, it will take a lot of time to debug this. Logical errors are especially hard to find. I have modified your according to the STL functions, have a look here and let me know if you dont understand anything. https://ide.codingblocks.com/s/295440

In your previous code, one thing you can ensure is that you checked for both a being a substring of b and b being a substring of b

actutally your code is not working on any of the test case

here is the correct code – https://ide.codingblocks.com/s/295563
your comparison for sub string is wrong

@anubhavb11 it was a minor mistake, see the overall logic. Did you understand the concept used?

1 Like

yes thank you so much i got it all

1 Like

@anubhavb11 dont forget to mark the doubt as resolved!

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.