题解 | #最大数#
最大数
https://www.nowcoder.com/practice/fc897457408f4bbe9d3f87588f497729
class Solution: def solve(self , nums): s = [str(i) for i in nums] for i in range(len(nums)): for j in range(i, len(nums)): if int(''.join([s[i], s[j]])) < int(''.join([s[j], s[i]])): s[i], s[j] = s[j], s[i] if s[0] == '0': return '0' return ''.join(s)