[LeetCode] 179. Largest Number
发布于# 解题报告
题目 Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Input: [10,2] Output: "210" Example 2: Input: [3,30,34,5,9] Output: "9534330" Note: The result may be very large, so you need to return a string instead of an integer. 解题报告 首先,这是一个贪心问题,也就是说如果数字 a 和数字 b 比较 a 应该放在前面,那么整个字符串中 a 一定是会在 b 之前的;如果 a 比 b 前,b 比 c 前,a 一定会在 c 前面。这一点容易想到但是难以证明,因为这种比较相对于单