最大子数组之和
连续子数组的最大和
https://www.nowcoder.com/practice/459bd355da1549fa8a49e350bf3df484?tpId=188&&tqId=38594&rp=1&ru=/activity/oj&qru=/ta/job-code-high-week/question-ranking
function FindGreatestSumOfSubArray(array)
{
// write code here
let max = array[0];
let dp = [array[0]]
for (let i = 1; i < array.length; i++) {
dp[i] = Math.max(array[i] + dp[i - 1], array[i]);
max = Math.max(max, dp[i]);
}
return max;
}