码迷,mamicode.com
首页 > 其他好文 > 详细

Maximum Subarray II

时间:2016-07-02 17:33:10      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:

Given an array of integers, find two non-overlapping subarrays which have the largest sum.
The number in each subarray should be contiguous.
Return the largest sum.

Notice

The subarray should contain at least one number

For given [1, 3, -1, 2, -1, 2], the two subarrays are [1, 3] and [2, -1, 2] or [1, 3, -1, 2] and [2], they both have the largest sum 7.

Maximum Subarray II

标签:

原文地址:http://www.cnblogs.com/sherylwang/p/5635642.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!