← Back

πŸ† Titan Concatenation Arena

Form the Largest Number from Array

βš”οΈ Number Champions βš”οΈ
Custom Comparator: Compare AB vs BA
Click Start to begin sorting!
πŸ† Largest Number Formed
?
Generate numbers and watch them compete!

πŸ“– Largest Number by Custom Sort

Key Insight: Compare by concatenation, not value!

Comparator: For A and B, compare AB vs BA

β€’ If "AB" > "BA": A should come before B

β€’ Example: 9 vs 34: "934" > "349", so 9 comes first

Time: O(n log n Γ— k) where k = max digit length