Form Biggest Number Problem

Hi!, while trying to solve this problem, i devised a simplified solution using an array of strings. This solution gives me the correct answers for all the values i could test, but doest seem to pass any of the testcases.
Please look into my code and see if i missed something or if its some technical issue.
Thanks! :smiley:

https://ide.codingblocks.com/s/300531 <<<<- my code

hi @ilovetocode consider a case where numbers given are
600 60
now the correct answer should be 60600
but your output will be 60060

The correct compare function will be

return a+b > b+a;

https://ide.codingblocks.com/s/300540 <<<- This is another approach using int array that works fine, but doesnt pass testcases. please help!

@ilovetocode again same logical mistake, ultimately you are converting it to string only. So your compare function should be the one I mentioned above.

Hi Ishita,
Thanks for pointing out the case! i hadn’t seen your respond before, i will try to account for this issue.

hi @ilovetocode please mark your doubt as resolved in case of no further queries