Sir I compiled the program , the ans was coming correct. But the test cases are coming wrong.
Test cases coming wrong
Hey @punetha.anmol001 there’s a small reason why you are failing these test cases, try to do it with test case
1
2
42 4
Expected should be 442
Yours is giving 424
Try to think about this, if you didn’t get any hint you can ask me. I will help you.
I did a small change, but just resolved it for your test case,have to make some other change for sure ik. But don’t you think there is some other problem as well bcz atleast some cases should pass.
I saw your latest code, what you are doing is this
string s1= to_string(a);
string s2=to_string(b);
if(s1.length()==s2.length()){
return s1>s2;
}
else if(s1.begin()==s2.begin()){
return s1<s2;
}
else{
return s1>s2;
}
Instead do what
Return s1+s2>s2+s1
And then see your output.
Got the logic, thanks sir.
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.