Why return a > b gives error?

bool comp(string a, string b){
string xy=a+b;
string yx=b+a;
return xy > yx;
}
bool comp(string a, string b){
return a> b
}
why second is not working even it also sort them lexcially. if we append a lexicaly smaller string to a greater string then also it should give same result.

Ok so assume u have
541 and 54
Now second function here will return 541 before 54
Bit in actual we want 54 to come before 541 because 54541 >54154

If this resolves ur query then please mark it as resolved :slight_smile: