please help me to find my code is not passing all test cases
the link to my code is given below
One test case failed
please reply faster it would be a great help
consider two words
bate and batman
accordingly
bate should come before batman
but your code checks only the first letter and then the string
so b and b will match and batman has larger length so it will put batman before bate which is wrong
correction: check is the first is substring of the second if yes then check the length, else delete the elements till they are same and then check which one should come first for which u can use the inbuilt compare function
if not clear, check the compare function used in this code
if your doubt is solved, please mark it as resolved