Maximal Subarray

Given an array, describe an algorithm to identify the subarray with the
maximum sum. For example, if the input is [1, -3, 5, -2, 9, -5, 6, -4],
the output would be: max sum: 13, [5, -2, 9, -5, 6]