solve the maximum sub array problem.