public class solution{
public int maxOfSubarray(int[] array){
int[]dp=new int[array.length];
dp[0]=array[0];
int max=array[0];
for(int i=0,i<array.length,i++){
dp[i]=Math.max(dp[i-1]+array[i];dp[i-1]);
max=Math.max(max,dp[i]);
}
return max
}
}
标签:int,max,Math,jz42,字数,array,public,dp,贪心 From: https://www.cnblogs.com/somedieyoung/p/16705778.html