数组累计最大和
子数组的最大累加和问题
http://www.nowcoder.com/questionTerminal/554aa508dd5d4fefbf0f86e5fe953abd
public int maxsumofSubarray (int[] arr) {
// write code here
int ret = arr[0];
for (int i = 1; i < arr.length; i++) {
arr[i] = Math.max(arr[i], arr[i-1]+arr[i]);
ret = Math.max (ret, arr[i]);
}
return ret;
}