Search⌘ K
AI Features

Solution: Largest Number

Explore a greedy technique to solve the largest number problem by defining a custom string comparison rule. Learn to reorder integer strings based on concatenation order to maximize the final combined number.

Statement

Given a list of non-negative integers, nums, rearrange them so that they form the largest possible number. As the result may be very large, return it as a string.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 0≤0 \leq nums[i] ≤103\leq 10^3 ...