Imp. Doubt of String

Sir I have doubt in this question as it is not giving me the desired output.

And Please tell about Comparators again. I am very much confused in that.

@aryangrover
Hello aryan,
the comparator u defined will sort strings in lexicographical order.
also there is an easy way to read string apart from getline.
simply do cin>>s1[i] in line no -16 to read ith string.

for clarity over comparator function please watch stl videos

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.