Lintcode44 Minimum Subarray solution 题解

xiaoxiao2021-02-28  70

【题目描述】

Given an array of integers, find the subarray with smallest sum.Return the sum of the subarray.

Notice:The subarray should contain one integer at least.

给定一个整数数组,找到一个具有最小和的子数组。返回其最小和。

注意:子数组最少包含一个数字

【题目链接】

http://www.lintcode.com/en/problem/minimum-subarray/

【题目解析】

和maximum subarray一样,用dynamic programming做,if condition不一样

【参考答案】

http://www.jiuzhang.com/solutions/minimum-subarray/

转载请注明原文地址: https://www.6miu.com/read-81547.html

最新回复(0)