def FindGreatestSumOfSubArray(dataList): summax = dataList[0] amax = dataList[0] for num in dataList[1:]: amax = max(amax + num, num) summax = max(amax, summax) return summax