通过重新排列的列表建设数量最多的可能 [英] Constructing the largest number possible by rearranging a list

查看:147
本文介绍了通过重新排列的列表建设数量最多的可能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有积极的整体整数数组;我想操纵顺序,以使所得到的阵列的串联数量最多的是可能的。例如 [97,9,13] 的结果 99713 ; [9,1,95,17,5] 的结果 9955171 。我不知道一个答案。

Say I have an array of positive whole integers; I'd like to manipulate the order so that the concatenation of the resultant array is the largest number possible. For example [97, 9, 13] results in 99713; [9,1,95,17,5] results in 9955171. I'm not sure of an answer.

推荐答案

排序(X,CMP =拉姆达A,B:-1,如果STR(B)+ STR(一)< STR( A)+ STR(二)其他1)

这篇关于通过重新排列的列表建设数量最多的可能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆