String comparision in c++


in this code i am getting the run code correct but not the submit code.all test cases ara wrong

@Chandra123 Your Logic is wrong somewhere.
Consider test case:
3
bat
bits
batman

Expected Output:
batman
bat
bits

Your Output:
bits
batman
bat

Make an STL compare function as taught in the lectures. Refer this code for help: