Solved maximum subarray problem with DP