该题即是昨天没有做出来的题目,想了很久,想出了一个普通的做法,提交发现超时了。思想是新建一个数组,保存每个元素与后面的元素相乘后得到的最大值,然后再在该数组中选出最大的值,返回。【笨死发现行不通后决定还是求教度娘了。果然大神无处不在,该题可运用动态规划思想解决。考虑到正负数相乘后会出现的各种结果,采...
分类:
其他好文 时间:
2014-11-02 00:29:13
阅读次数:
276
LeetCode Maximum Subarray 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 su...
分类:
其他好文 时间:
2014-10-30 07:12:42
阅读次数:
151
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,...
分类:
编程语言 时间:
2014-10-29 12:31:32
阅读次数:
188
题目描述:
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...
分类:
其他好文 时间:
2014-10-29 09:15:57
阅读次数:
139
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,...
分类:
其他好文 时间:
2014-10-24 18:14:41
阅读次数:
180
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the largest pr...
分类:
编程语言 时间:
2014-10-24 13:01:16
阅读次数:
222
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the...
分类:
其他好文 时间:
2014-10-24 10:26:11
阅读次数:
269
[Description] Given an array with only '1' and '0', find a largest length sub-array which contains equal number of '1' and '0'. Return the largest num...
分类:
其他好文 时间:
2014-10-22 20:14:33
阅读次数:
209
Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given...
分类:
其他好文 时间:
2014-10-22 19:51:21
阅读次数:
272
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the...
分类:
其他好文 时间:
2014-10-22 14:29:45
阅读次数:
171