linear running time -maximum subarray

using linear running time to solve maximum subarray