Error in the code

what is the error in my code and please rectify and also check if my logic is correct and my code is giving the correct output.


Reply as soon as possible with the corrected code.

@D19APPPP0016
Write getline(cin,arr[0]); just after line 85. Your code will work.

Read this article https://discuss.codechef.com/t/facing-problem-with-getline-in-cpp/43577/4
You will get why we have to write an extra getline()

Can u explain in more detailed and easy manner that how we are using getline here and also i am not getting the correct output for lexicographical format so also check my logic for that compare function

modified code https://ide.codingblocks.com/s/257173

@D19APPPP0016
I think you are getting correct output for lexicographical as well. Can you please give me example for any testcase where your code isn’t working

check this one https://ide.codingblocks.com/s/257233

@D19APPPP0016
Change line 71 to x+=a[i]; and 79 to y+=b[j];
Comment out line 75 and 83 ( i.e x[k]=’\0’ and y[k]=’\0’; )
Your code will work fine.