Medium

Quiz

#179 Largest Number

APPROACH

Given a list of non-negative integers nums, arrange them to form the numerically largest possible number and return it as a string (since the result may be very large).

Example 1:

Input: nums = [10,2]
Output: "210"

Example 2:

Input: nums = [3,30,34,5,9]
Output: "9534330"
1 of 4
1:00

What is the optimal approach for this problem?