adding maximum sub-array problem solution