Why am I getting a compilation error

also is there any flow in the logic (using lexicographical sorting)

@amangupta take input like this cin >> s[i];

I changed the input format however the array of strings isn’t getting sorted using the sort function

@amangupta they are getting sorted. You did not use a custom compare function to do any modifications in sort function so they are getting sorted in lexicographical order only

I made the comparator and I am getting the correct answer as well , However when I submit the code it gives me wrong answer and rejects my submission
Here is the code: https://ide.codingblocks.com/s/296702

@amangupta

  1. the problem with this approach is that it will give wrong answer for cases like
    600 60
    we want 60600
    but the answer will come out to be 60060 according to this approach.
    So the comparator should be return a+b > b+a

  2. Print answer of each test case in a new line.

could you please elaborate point 1

@amangupta i gave you an input for which your code is failing, what do you want me to elaborate please telll

A+B>B+A how will this affect the comparator

@amangupta by normal comparison 60 and 600 are not sorted like we want, so we check their combination whether a should come first or b