class Solution():
def minnum(self,numbers):
for i in range(len(numbers)-1,0,-1):
for j in range(0,i):
if int(str(numbers[j])+str(numbers[j+1]))>int(str(numbers[j+1])+str(numbers[j])):
numbers[j],numbers[j+1] = numbers[j+1],numbers[j]
res = ''
for i in numbers:
res+=str(i)
return int(res) if res else res
s = Solution()
print(s.minnum([]))
网友评论