computer max sum of sub arrays of an array