maximum subarray leetcode, iterative and divide and conquer methods