I am submitting my problem but all test are failing while i check from input cases it is giving right output.
Please resolve the issue.
I am submitting my problem but all test are failing while i check from input cases it is giving right output.
Please resolve the issue.
hi @mukuuu if a string is like this “90” “9009” then the expected answer is “909009” but this code will give answer as “90090”. So you need to make changes in your compare function
bool compare(int a , int b)
{
string s1 = to_string(a);
string s2 = to_string(b);
string s3 = s1+s2;
string s4 = s2+s1;
return s3>s4;
it is sorted now thanks for the help