问题描述:
Given a list of non negative integers, arrange them such that they form the largest number.
For example, given [3, 30, 34, 5, 9], the largest formed number is
9534330.
Note: The result may...
分类:
其他好文 时间:
2015-01-14 21:28:06
阅读次数:
196
https://oj.leetcode.com/problems/largest-number/publicclassSolution{
publicStringlargestNumber(int[]num)
{
if(num==null||num.length==0)
return"";
//Converttostring.
List<String>strs=newArrayList<>();
for(inti:num)
strs.add(String.valueOf(i));
..
分类:
其他好文 时间:
2015-01-14 18:17:50
阅读次数:
152
Given a list of non negative integers, arrange them such that they form the largest number.
For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.
Note: The result may be ve...
分类:
其他好文 时间:
2015-01-14 09:47:36
阅读次数:
99
Largest NumberGiven a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the larg...
分类:
其他好文 时间:
2015-01-13 23:04:26
阅读次数:
307
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] ha...
分类:
其他好文 时间:
2015-01-13 21:46:20
阅读次数:
181
Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num...
分类:
其他好文 时间:
2015-01-13 17:36:57
阅读次数:
97
【题目】
Given a list of non negative integers, arrange them such that they form the largest number.
For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.
Note: The result...
分类:
其他好文 时间:
2015-01-13 16:04:41
阅读次数:
147
给一组数字求拼起来最大的那个,其实按照我们的想法就是把大的放前面呗,那到底哪个大呢。数字a,b拼接起来就是ab,或者ba看这两个哪个大,就ab大就把a放前面,ba大就把b放前面。排个序就好。。。注意考虑都是0的情况。。。(因为下面我们用的是字符串class Solution {public: ...
分类:
其他好文 时间:
2015-01-13 10:28:45
阅读次数:
106
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] ha...
分类:
其他好文 时间:
2015-01-12 13:07:22
阅读次数:
149
# include # include # include # include using namespace std;__int64 a[100010],l[100010],r[100010];///l[i]左边连续大于等于a[i]的下标,r[i]右边连续大于等于a[i]的下标,所以对于a[i]的...
分类:
其他好文 时间:
2015-01-11 21:37:01
阅读次数:
323