Here is the problem:

Write a function that given a list of non negative integers, arranges them such that they form the largest possible number. For example, given [50, 2, 1, 9], the largest formed number is 95021.

 

思路跟冒泡排序似的,按照元素的位数比较大小。

具体代码如下: