给定一个有正有负的整数数组A及其大小n,返回从前往后相加最大的连续数列的和。保证n的大小小于等于3000。 测试样例: [1,2,3,-6,1] 返回:6
加载中...
import java.util.*; public class MaxSum { public int getMaxSum(int[] A, int n) { // write code here } }
class MaxSum { public: int getMaxSum(vector
A, int n) { // write code here } };
# -*- coding:utf-8 -*- class MaxSum: def getMaxSum(self, A, n): # write code here
class MaxSum { public int getMaxSum(int[] A, int n) { // write code here } }