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 create112212
. Given the list of number, calculate the string representing the smallest possible number.
minimumNumber([ 1, 2, 12, 21, 0 ]);
"112212"