Link:https://ide.codingblocks.com/s/356425
Please do it as soon as possible .Thankyou
Hey @KetanPandey
1)You forgot to add endl
2)Remove cout statements from compare
3)Failing for simple test case like this
1
2
605 6051
code is still not passing sample test case.Please help
Bro compare function will be much more complex if u try to solve it using integers
Say we have 653 and 65361
Now we will place 653 first and 65361 later
why because 65361653<65365361
So ur code will check for first 3 digits but for rest it simply return on the basis of length but instead we again have to check here 653 and 65361 so it will check 653 now nums remains 0 and 61
so we again will check for 653 and 61 …and it can be much more complex this is just what I am getting
So instead take nums as strings
and compar if a+b>b+a and return accordingly ,they will automatically do all that
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.