http://www.lintcode.com/en/problem/largest-number/
Given a list of non negative integers, arrange them such that they form the largest number.
Example
Given[1, 20, 23, 4, 8], the largest formed number is8423201.
Challenge
Do it in O(nlogn) time complexity.
思路:
1. 先把number数组转化为String数组
2. 利用Arrays.sort(), comparator方法比较element in String[]大小
3. 排好序后, 利用StringBuffer合并成String, 并检查是否有0情况,有即利用substring(index)删除
网友评论