10. Minimum Number

Difficulty: 

We have a list of non-negative numbers and would like to stick them together to create the smallest number possible. All numbers should be used, and no other operation is allowed except concatenating the numbers. For example, we can use [12, 1, 2, 21] to create 112212. Given the list of number, calculate the string representing the smallest possible number.

Input:

minimumNumber([
  1,
  2,
  12,
  21,
  0
]);

Output:

"112212"

Time Limit:

500 (ms)

Hints (hover to see):

  • Hint #1
  • Hint #2



Results

ProblemsAcceptedWrongTimed OutError
130000

Input:

Expected Output:

Output: