python
from functools import cmp_to_key
class Solution:
def largestNumber(self, nums: List[int]):
if not nums:
return ''
res = '0'
def compare(x, y):
return -(int(x+y) - int(y+x))
nums = sorted(map(str, nums), key=cmp_to_key(compare))
return res if nums[0]=='0' else ''.join(nums)