String sort problem

i am not able to get why my one test case is failing

Hi
Try to take input using “cin” instead of “getline”
and try again.

If you have any other doubt, please feel free to ask again.