179 Largest Number
Last updated
Was this helpful?
Last updated
Was this helpful?
Given a list of non negative integers, arrange them such that they form the largest number.
For example, given[3, 30, 34, 5, 9]
, the largest formed number is9534330
.
Note: The result may be very large, so you need to return a string instead of an integer.
(1) Sort
时间复杂度O(nlogn), n是nums里的元素个数, 空间复杂度O(n)