美文网首页创新写作
LintCode问题图解-27

LintCode问题图解-27

作者: billliu_0d62 | 来源:发表于2017-11-06 10:36 被阅读26次

    本文准备讲解1个算法编程问题, 这个算法编程问题来自LintCode平台。不了解.LintCode平台的读者可以阅读笔者文章(在线编程平台推荐-LeetCode)。问题的英文版本描述如下:

    Maximum Subarray Difference

    Find two non-overlapping subarrays and B. |SUM(A) - SUM(B)| is the largest.

    Return the largest difference.

    Notice

    The subarray should not be empty.

    Example

    For [1, 2, -3, 1], return 6.

    子数组

    Find two non-overlapping subarrays and B。|SUM(A) - SUM(B)| is the largest. 

    返回这个最大的差值。

    注意事项

    The subarray should not be empty.

    样例

    For [1, 2, -3, 1], return 6.

    推荐阅读作者的文章 LintCode问题图解-26。Maximum Subarray 类别的问题是比较简单的。本问题的主要特点为需要将1个数组切分为2个数组。需要找到这个数组切分点。

    简单的算法

    相关文章

      网友评论

        本文标题:LintCode问题图解-27

        本文链接:https://www.haomeiwen.com/subject/ykwkmxtx.html