added solution to the maximum subarray problem