zoukankan      html  css  js  c++  java
  • Maximum Subarray II

    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.

  • 相关阅读:
    wireshark 实用过滤表达式(针对ip、协议、端口、长度和内容)
    32:从1到n整数中1出现的次数
    31:连续子数组的最大和
    30:最小的K个数
    29:数组中出现次数超过一半的数字
    28:字符串的排列
    27:二叉搜索树与双向链表
    26:复杂链表的复制
    25:二叉树中和为某一个定值的路径
    24:二叉搜索树的后序遍历序列
  • 原文地址:https://www.cnblogs.com/sherylwang/p/5635642.html
Copyright © 2011-2022 走看看