Why is this code not working?

It is giving me the correct output with Sample Test Cases, and other test cases as well. But at Hackerblocks it is not accepting.
Here’s the link to my code. https://ide.codingblocks.com/s/87938

@raghav6 hey raghav let consider the following case
8
1 34 3 98 9 76 45 4
if you sort these numbers then
sorted number is
1 3 4 9 34 45 76 98
now reverse
987645349431
but actually the output should be
998764543431
now design a compare function which will passed with sort function
your implementation will not work

Used a custom comparator and it worked. Thanks!

@raghav6 happy coding !