Largest Number - Custom Comparator

You cannot sort by numeric value (30>330 > 3 but "330">"303""330" > "303"). The key insight: compare two numbers aa and bb by checking if ab>baab > ba when concatenated as strings.

For 33 and 3030: compare "330""330" vs "303""303". Since "330">"303""330" > "303", 33 should come before 3030.

This comparison is transitive, so standard sorting algorithms work correctly with this custom comparator.