ha = ['3','34','1','13','5']
print(ha.sort)
print(ha)
print(max(ha))
def solution(numbers):
count = len(str(max(numbers)))
nums = [str(x) for x in numbers]
nums.sort()
rlt = ''
left = ''
for i in range(1, count+1):
sub_num = [x for x in nums if len(x) == i]
print(sub_num, nums)
while sub_num:
temp = sub_num[-1]
if temp == '0':
left += temp
sub_num.remove(temp)
nums.remove(temp)
else:
if sub_num[-1] == nums[-1]:
rlt += temp
sub_num.remove(temp)
nums.remove(temp)
else:
if sub_num[-1][-1] > nums[-1][-1]:
temp = sub_num[-1]
rlt += temp
sub_num.remove(temp)
nums.remove(temp)
else:
temp = nums[-1]
rlt += temp
nums.remove(temp)
# print(sub_num, nums)
rlt += left
return rlt
num = [3, 30, 34, 5, 9]
print(solution(num))