Given an array of integers and a numberk, find knon-overlappingsubarrays which have the largest sum.The number in each subarray should becontiguous.Re...
分类:
其他好文 时间:
2015-11-19 07:01:51
阅读次数:
355
1. TitleMaximum Subarray2. Http addresshttps://leetcode.com/problems/maximum-subarray/3. The questionFind the contiguous subarray within an array (con...
分类:
其他好文 时间:
2015-11-16 22:25:53
阅读次数:
132
1. TitleMaximum Product Subarray2. Http addresshttps://leetcode.com/problems/maximum-product-subarray/3. The questionFind the contiguous subarray with...
分类:
其他好文 时间:
2015-11-16 22:23:03
阅读次数:
207
题目和大于S的最小子数组给定一个由 n 个整数组成的数组和一个正整数 s ,请找出该数组中满足其和 ≥ s 的最小长度子数组。如果无解,则返回 -1。样例给定数组[2,3,1,2,4,3]和 s =7, 子数组[4,3]是该条件下的最小长度子数组。挑战如果你已经完成了O(n)时间复杂度的编程,请再试...
分类:
编程语言 时间:
2015-11-11 23:49:45
阅读次数:
461
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...
分类:
其他好文 时间:
2015-11-04 09:59:24
阅读次数:
132
https://leetcode.com/problems/minimum-size-subarray-sum/Given an array ofnpositive integers and a positive integers, find the minimal length of a suba...
分类:
其他好文 时间:
2015-11-01 16:32:57
阅读次数:
130
题目连续子数组求和给定一个整数数组,请找出一个连续子数组,使得该子数组的和最大。输出答案时,请分别返回第一个数字和最后一个数字的值。(如果两个相同的答案,请返回其中任意一个)样例给定[-3, 1, 3, -3, 4], 返回[1,4].解题法一:直接暴力,时间复杂度O(N2),时间超时public ...
分类:
编程语言 时间:
2015-10-30 21:46:10
阅读次数:
414
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,...
分类:
编程语言 时间:
2015-10-30 12:23:19
阅读次数:
165
1 class Solution { 2 public: 3 /** 4 * @param nums: a list of integers 5 * @return: A integer denote the sum of minimum subarray 6 ...
分类:
编程语言 时间:
2015-10-26 18:45:52
阅读次数:
160
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...
分类:
其他好文 时间:
2015-10-21 06:52:27
阅读次数:
225