题目84 多个数组成最大数字--python

def mergeMaxValue(lst):
    m = len(max(lst, key=len))
    newLst = [(i,i+i[-1]*(m-len(i))) for i in lst]
    newLst.sort(key=lambda item:item[1], reverse=True)
    result = "".join(item[0] for item in newLst)
    print(result)

lst = list(map(str, input().split(',')))
mergeMaxValue(lst)
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务