Why cant i sort the array after taking the numbers in an array? please tell my mistake in my code

??why cant i sort the array after taking the numbers in an array? please tell my mistake in my code https://ide.codingblocks.com/s/670192

hi @akshat1409
consider nos are 100 and 10
you will sort and print 10010 but ans is 10100
so check which is greater either 10 + 100 or 100 + 10 then return from custom comparator

here’s the updated code : https://ide.codingblocks.com/s/661893

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.